Skip to content

Commit

Permalink
Solution for day 21, part 2.
Browse files Browse the repository at this point in the history
  • Loading branch information
hainesr committed Dec 28, 2024
1 parent fdbe695 commit e1247c8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/aoc2024/days/keypad_conundrum.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ def part1
@codes.sum { |code| min_moves_for_code(code) * code.to_i }
end

def part2
@codes.sum { |code| min_moves_for_code(code, 25) * code.to_i }
end

def moves_to_position(start, finish, deadspot)
return ['A'] if start == finish

Expand Down

0 comments on commit e1247c8

Please sign in to comment.