-
-
Save funny-falcon/0f61703123f56e35b8f4c9a66c8f13cc 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
h = {} of UInt64 => Array(String) | |
STDIN.each_line do |line| | |
line = line.chomp | |
hv = line.hash | |
if h.has_key?(hv) | |
ar = h[hv] | |
unless ar.includes?(line) | |
ar.push(line) | |
end | |
else | |
h[hv] = [line] | |
end | |
end | |
h.each do |hv, ar| | |
if ar.size > 1 | |
puts hv | |
p ar | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment