[2016][ruby][18.1]

profile
Alpha Chen 8 years ago
parent 2e1eba56a5
commit f3bd338b7d

@ -26,11 +26,12 @@ end
if __FILE__ == $0 if __FILE__ == $0
row = Row.from_s(DATA.read.chomp) row = Row.from_s(DATA.read.chomp)
rows = [row] count = 0
while rows.size < 40 400_000.times do
rows << rows.last.next count += row.tiles.count(:safe)
row = row.next
end end
p rows.map {|row| row.tiles.count(:safe) }.inject(:+) p count
end end
require 'minitest' require 'minitest'

Loading…
Cancel
Save