added code to solve part 2

master^2
Jeff Yates 2 years ago
parent 2330820811
commit 7574cfa2ae
  1. 4
      day15/solution.rb

@ -3,7 +3,9 @@ require 'pry'
numbers = File.read('./input').split(',')
numbers.map!(&:to_i)
2020.times do |i|
runs = 30000000
runs.times do |i|
next if i < numbers.size
num = numbers[-1]
prev_turn = numbers[..-2].reverse.find_index(num)

Loading…
Cancel
Save