Skip to content

Commit

Permalink
fix part 1
Browse files Browse the repository at this point in the history
  • Loading branch information
golubitsky committed Sep 16, 2024
1 parent 9c8f7af commit 55ad7f7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dsa/advent-of-code/2017/day_20.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def solution(data, part = 1)

# heuristic: assume that if the same particle is closest n times in a row
# it will always be closest
arbitrary_threshold = 100
arbitrary_threshold = 500
if count == arbitrary_threshold
return last_index if part == 1
return particles.count if part == 2
Expand All @@ -88,5 +88,6 @@ def solution(data, part = 1)

if __FILE__ == $0
data = File.readlines('day_20_input.txt')
pp solution(data, part = 1)
pp solution(data, part = 2)
end

0 comments on commit 55ad7f7

Please sign in to comment.