Skip to content

Instantly share code, notes, and snippets.

@rafaltrojanowski
Last active November 26, 2017 09:25
Show Gist options
  • Save rafaltrojanowski/c31e3e61bc9d3e8a06392c84dde6111f to your computer and use it in GitHub Desktop.
Save rafaltrojanowski/c31e3e61bc9d3e8a06392c84dde6111f to your computer and use it in GitHub Desktop.
def solution(a)
# write your code in Ruby 2.2
i = 1
hash = {}
a.each do |element|
hash[element] = 1
end
while 1 do
if hash[i].nil?
return i
break
end
i += 1
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment