Created
August 28, 2018 22:31
-
-
Save juanfurattini/0f878cb50b3136e98e233ac762e3e114 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
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