Skip to content

Instantly share code, notes, and snippets.

@juanfurattini
Last active July 26, 2018 05:20
Show Gist options
  • Save juanfurattini/0b3cd63ccd8bb3e231e0cde4861556d0 to your computer and use it in GitHub Desktop.
Save juanfurattini/0b3cd63ccd8bb3e231e0cde4861556d0 to your computer and use it in GitHub Desktop.
Solution for Codility's MissingInteger exercise with a score of 100% (Ruby)
def solution(a)
val = 0
a.uniq.sort.each do |e|
next if e <= 0
return val.next if e > val.next
val = e
end
val.next
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment