Skip to content

Instantly share code, notes, and snippets.

@negabaro
Created December 1, 2015 05:25
Show Gist options
  • Save negabaro/97702aa74c34ffe2a3a4 to your computer and use it in GitHub Desktop.
Save negabaro/97702aa74c34ffe2a3a4 to your computer and use it in GitHub Desktop.
cnt =0
inputs = []
while str = STDIN.gets
inputs << str.to_i
end
inputs.each do |i|
inputs2 = inputs.dup
inputs2.delete(i)
inputs2.each do | j |
if (i.to_i + j.to_i) == 0 then
inputs.delete(i)
cnt = cnt + 1
end
end
end
puts cnt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment