Skip to content

Instantly share code, notes, and snippets.

@chuck0523
Created January 12, 2016 15:35
Show Gist options
  • Save chuck0523/f211105c9642615de170 to your computer and use it in GitHub Desktop.
Save chuck0523/f211105c9642615de170 to your computer and use it in GitHub Desktop.
n = gets.to_i
visited = [].fill(0, 0, n)
bloomed = 0
n.times do |t|
f = gets.to_i
if visited[f] != 0
bloomed += 1
else
visited[f] = 1
end
end
puts bloomed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment