Skip to content

Instantly share code, notes, and snippets.

@fantgeass
Created November 28, 2016 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fantgeass/b8b20c3b93be92da61ea748a5b607347 to your computer and use it in GitHub Desktop.
Save fantgeass/b8b20c3b93be92da61ea748a5b607347 to your computer and use it in GitHub Desktop.
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