Skip to content

Instantly share code, notes, and snippets.

@juanfurattini
Created August 28, 2018 22:31
Show Gist options
  • Save juanfurattini/0f878cb50b3136e98e233ac762e3e114 to your computer and use it in GitHub Desktop.
Save juanfurattini/0f878cb50b3136e98e233ac762e3e114 to your computer and use it in GitHub Desktop.
def solution(a)
val = 0
a.sort.each do |e|
return 0 if e <= 0 || e == val || e > val.next
val = e
end
1
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment