Created
November 28, 2016 14:02
-
-
Save fantgeass/b8b20c3b93be92da61ea748a5b607347 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Solution do | |
def get_max([ head | tail ]), do: get_max(tail, head) | |
def get_max([ head | tail ], max), do: get_max(tail, (if head > max, do: head, else: max)) | |
def get_max([], max), do: max | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment