You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
9 lines
167 B
9 lines
167 B
6 years ago
|
require "set"
|
||
|
|
||
|
seen = Set.new
|
||
|
ARGF.read.lines.map(&:to_i).cycle.each.with_object([0]) do |i,n|
|
||
|
n[0] += i
|
||
|
p n[0] and exit if seen.include?(n[0])
|
||
|
seen << n[0]
|
||
|
end
|