diff --git a/2024/day20/input b/2024/day20/input new file mode 100644 index 0000000..55d2a71 --- /dev/null +++ b/2024/day20/input @@ -0,0 +1,141 @@ +############################################################################################################################################# +#...#...#.................#...#.....#.....#...###...###...#.........#...###...........#.....#...#######...#.....#.............#.......###...# +#.#.#.#.#.###############.#.#.#.###.#.###.#.#.###.#.###.#.#.#######.#.#.###.#########.#.###.#.#.#######.#.#.###.#.###########.#.#####.###.#.# +#.#.#.#.#...#.........#...#.#.#.#...#.#...#.#.#...#.#...#.#.....#...#.#.....#.........#.#...#.#...###...#.#...#.#.....#.....#...#.....#...#.# +#.#.#.#.###.#.#######.#.###.#.#.#.###.#.###.#.#.###.#.###.#####.#.###.#######.#########.#.###.###.###.###.###.#.#####.#.###.#####.#####.###.# +#.#...#...#.#.#.....#.#.###.#...#.#...#.#...#.#...#.#...#.#.....#...#.......#.#...#.....#...#...#...#.#...#...#.#...#.#...#.#.....#.....#...# +#.#######.#.#.#.###.#.#.###.#####.#.###.#.###.###.#.###.#.#.#######.#######.#.#.#.#.#######.###.###.#.#.###.###.#.#.#.###.#.#.#####.#####.### +#.#.......#...#...#...#.#...#.....#...#.#.#...#...#...#.#.#.......#...#...#.#.#.#.#.#.......###...#.#.#.###.#...#.#...#...#...#...#.....#...# +#.#.#############.#####.#.###.#######.#.#.#.###.#####.#.#.#######.###.#.#.#.#.#.#.#.#.###########.#.#.#.###.#.###.#####.#######.#.#####.###.# +#.#.#...#...#...#.....#...#...###...#.#.#.#...#...#...#.#.#...###...#...#...#...#...#...###...#...#...#.....#...#...#...###...#.#.#...#.#...# +#.#.#.#.#.#.#.#.#####.#####.#####.#.#.#.#.###.###.#.###.#.#.#.#####.###################.###.#.#.###############.###.#.#####.#.#.#.#.#.#.#.### +#.#.#.#.#.#...#.....#.....#.#...#.#.#.#.#...#.....#.....#...#.#.....#.........#...#.....#...#.#.#.........#.....#...#.#...#.#.#.#...#...#...# +#.#.#.#.#.#########.#####.#.#.#.#.#.#.#.###.#################.#.#####.#######.#.#.#.#####.###.#.#.#######.#.#####.###.#.#.#.#.#.###########.# +#.#.#.#.#.......#...#.....#.#.#.#.#.#.#.###.......#.........#.#...#...#...###...#...#...#...#.#.#.......#...#...#.#...#.#.#.#...#.........#.# +#.#.#.#.#######.#.###.#####.#.#.#.#.#.#.#########.#.#######.#.###.#.###.#.###########.#.###.#.#.#######.#####.#.#.#.###.#.#.#####.#######.#.# +#.#...#.###...#.#...#.....#...#.#.#...#...#...###...#...###.#.###.#...#.#...#.........#.#...#...#...#...#...#.#.#.#.#...#...#.....#...###...# +#.#####.###.#.#.###.#####.#####.#.#######.#.#.#######.#.###.#.###.###.#.###.#.#########.#.#######.#.#.###.#.#.#.#.#.#.#######.#####.#.####### +#.#...#.....#...#...#.....#.....#.....#...#.#.#.....#.#.#...#...#.#...#.#...#.#.........#.......#.#...#...#.#.#.#.#.#.#.......#.....#.#...### +#.#.#.###########.###.#####.#########.#.###.#.#.###.#.#.#.#####.#.#.###.#.###.#.###############.#.#####.###.#.#.#.#.#.#.#######.#####.#.#.### +#.#.#.#...#.....#.###.....#.#...#.....#...#.#.#...#.#.#.#.#...#...#...#.#...#.#...#...#.....#...#...###.#...#.#.#.#.#.#...#...#.#.....#.#...# +#.#.#.#.#.#.###.#.#######.#.#.#.#.#######.#.#.###.#.#.#.#.#.#.#######.#.###.#.###.#.#.#.###.#.#####.###.#.###.#.#.#.#.###.#.#.#.#.#####.###.# +#...#...#.#.#...#...#...#.#.#.#.#.......#.#.#...#.#...#.#...#...#.....#...#...#...#.#.#...#...#.....#...#...#.#...#...#...#.#.#.#.#...#...#.# +#########.#.#.#####.#.#.#.#.#.#.#######.#.#.###.#.#####.#######.#.#######.#####.###.#.###.#####.#####.#####.#.#########.###.#.#.#.#.#.###.#.# +#.........#.#.....#...#...#.#.#...#...#.#.#...#.#.....#.......#.#...#.....#.....#...#...#.....#.#...#.#.....#.#...#.....#...#...#...#.....#.# +#.#########.#####.#########.#.###.#.#.#.#.###.#.#####.#######.#.###.#.#####.#####.#####.#####.#.#.#.#.#.#####.#.#.#.#####.#################.# +#...#.......#...#.#.......#...#...#.#.#.#.#...#.#...#.......#.#.#...#...#...#...#.....#.#...#.#.#.#...#.#...#.#.#.#.....#...#...........#...# +###.#.#######.#.#.#.#####.#####.###.#.#.#.#.###.#.#.#######.#.#.#.#####.#.###.#.#####.#.#.#.#.#.#.#####.#.#.#.#.#.#####.###.#.#########.#.### +#...#.#.......#.#...#...#.....#...#.#.#.#.#...#...#.#...#...#...#.#...#.#.###.#.#.....#.#.#...#.#.#.....#.#.#.#.#...#...#...#.........#.#.### +#.###.#.#######.#####.#.#####.###.#.#.#.#.###.#####.#.#.#.#######.#.#.#.#.###.#.#.#####.#.#####.#.#.#####.#.#.#.###.#.###.###########.#.#.### +#.....#.......#.....#.#.#...#...#...#...#...#.#...#...#.#...#.....#.#.#.#.#...#.#.....#.#.#.....#.#.###...#...#...#...###.#...#.......#.#...# +#############.#####.#.#.#.#.###.###########.#.#.#.#####.###.#.#####.#.#.#.#.###.#####.#.#.#.#####.#.###.#########.#######.#.#.#.#######.###.# +#...#...#...#.....#.#.#...#.....#.......#...#...#...#...#...#.#...#.#.#.#.#.#...#...#.#...#...#...#...#...#.......#...#...#.#...###...#.....# +#.#.#.#.#.#.#####.#.#.###########.#####.#.#########.#.###.###.#.#.#.#.#.#.#.#.###.#.#.#######.#.#####.###.#.#######.#.#.###.#######.#.####### +#.#...#...#.....#.#.#.............#...#.#.#...#...#.#.###...#.#.#.#.#.#.#.#.#.###.#.#.....#...#...#...#...#.......#.#.#.#...###...#.#.......# +#.#############.#.#.###############.#.#.#.#.#.#.#.#.#.#####.#.#.#.#.#.#.#.#.#.###.#.#####.#.#####.#.###.#########.#.#.#.#.#####.#.#.#######.# +#.............#...#.#...#...#...#...#...#.#.#.#.#.#.#.....#.#.#.#.#.#.#.#...#...#.#.#...#.#...#...#.#...#.......#.#.#...#.......#...#.......# +#############.#####.#.#.#.#.#.#.#.#######.#.#.#.#.#.#####.#.#.#.#.#.#.#.#######.#.#.#.#.#.###.#.###.#.###.#####.#.#.#################.####### +#.......#...#.....#...#...#...#.#.......#.#.#.#.#.#...#...#.#.#.#.#.#.#.....###.#.#.#.#.#...#.#...#...###.....#...#...#.........#...#...#...# +#.#####.#.#.#####.#############.#######.#.#.#.#.#.###.#.###.#.#.#.#.#.#####.###.#.#.#.#.###.#.###.###########.#######.#.#######.#.#.###.#.#.# +#.....#.#.#.......#.....#.....#.#.......#.#.#.#.#...#.#.#...#.#.#.#.#.#...#...#.#.#.#.#.#...#...#.#.........#.#...###.#.......#.#.#.....#.#.# +#####.#.#.#########.###.#.###.#.#.#######.#.#.#.###.#.#.#.###.#.#.#.#.#.#.###.#.#.#.#.#.#.#####.#.#.#######.#.#.#.###.#######.#.#.#######.#.# +#...#.#.#...........#...#.#...#.#.......#.#.#.#.#...#.#...###.#.#...#.#.#.#...#.#.#.#.#.#.....#...#.......#.#...#.....#.......#...###.....#.# +#.#.#.#.#############.###.#.###.#######.#.#.#.#.#.###.#######.#.#####.#.#.#.###.#.#.#.#.#####.###########.#.###########.#############.#####.# +#.#...#...........###...#.#...#.........#.#.#...#...#.#.......#.....#.#.#.#.#...#.#.#.#.....#...#.........#...........#.....#...#...#.#.....# +#.###############.#####.#.###.###########.#.#######.#.#.###########.#.#.#.#.#.###.#.#.#####.###.#.###################.#####.#.#.#.#.#.#.##### +#.#...#.........#.#...#...###...........#.#...#...#.#.#.#.....#.....#...#.#.#.#...#.#.#.....#...#.#.......#.........#.#...#...#...#...#.....# +#.#.#.#.#######.#.#.#.#################.#.###.#.#.#.#.#.#.###.#.#########.#.#.#.###.#.#.#####.###.#.#####.#.#######.#.#.#.#################.# +#...#...#...#...#...#...###...#.........#.....#.#...#.#.#.#...#.........#...#.#...#.#.#.#...#...#.#.#.....#.#.......#...#.#...#...#.........# +#########.#.#.#########.###.#.#.###############.#####.#.#.#.###########.#####.###.#.#.#.#.#.###.#.#.#.#####.#.###########.#.#.#.#.#.######### +###.......#...#...#...#.....#.#...........###...#...#.#.#.#.#.....#...#...###.....#.#.#.#.#.....#...#.#...#.#...........#.#.#.#.#.#.........# +###.###########.#.#.#.#######.###########.###.###.#.#.#.#.#.#.###.#.#.###.#########.#.#.#.###########.#.#.#.###########.#.#.#.#.#.#########.# +#...#...........#...#...#...#.....#.....#...#.....#.#.#.#.#.#.###.#.#.#...#...#...#...#.#...#...#...#...#...#...........#.#.#.#.#.....#.....# +#.###.#################.#.#.#####.#.###.###.#######.#.#.#.#.#.###.#.#.#.###.#.#.#.#####.###.#.#.#.#.#########.###########.#.#.#.#####.#.##### +#.....#...............#...#.#...#...#...#...#...###.#.#.#.#.#.#...#.#.#.....#...#.###...#...#.#...#...###...#...........#...#...###...#.....# +#######.#############.#####.#.#.#####.###.###.#.###.#.#.#.#.#.#.###.#.###########.###.###.###.#######.###.#.###########.###########.#######.# +#.....#.......#.....#.#...#.#.#.#...#...#.#...#...#...#...#...#...#.#...#.....#...#...#...###.......#.#...#...........#...###.......#...#...# +#.###.#######.#.###.#.#.#.#.#.#.#.#.###.#.#.#####.###############.#.###.#.###.#.###.###.###########.#.#.#############.###.###.#######.#.#.### +#.#...###...#...#...#.#.#.#.#.#...#...#...#.#.....###.....###.....#.#...#...#...###...#...#...#...#.#.#.............#...#...#...#...#.#.#...# +#.#.#####.#.#####.###.#.#.#.#.#######.#####.#.#######.###.###.#####.#.#####.#########.###.#.#.#.#.#.#.#############.###.###.###.#.#.#.#.###.# +#.#...#...#...###...#.#.#.#...#.......#...#.#.###...#.#...#...#...#.#.#...#.........#.#...#.#...#...#...............###.....###...#.#.#.#...# +#.###.#.#####.#####.#.#.#.#####.#######.#.#.#.###.#.#.#.###.###.#.#.#.#.#.#########.#.#.###.#######################################.#.#.#.### +#...#.#.....#...#...#...#.......#.......#...#.....#...#...#...#.#...#.#.#.#...#...#.#.#.#...#...#.............................###...#.#.#...# +###.#.#####.###.#.###############.#######################.###.#.#####.#.#.#.#.#.#.#.#.#.#.###.#.#.###########################.###.###.#.###.# +###.#.###...#...#.....#...#.......#...............#...#...#...#.#.....#.#...#...#.#.#.#.#.#...#.#.#.............#...#...#...#...#.....#...#.# +###.#.###.###.#######.#.#.#.#######.#############.#.#.#.###.###.#.#####.#########.#.#.#.#.#.###.#.#.###########.#.#.#.#.#.#.###.#########.#.# +#...#.....#...#...#...#.#.#.#.....#.............#...#...###.#...#.....#.....#.....#.#...#...###...#...........#.#.#...#.#.#.....###.....#...# +#.#########.###.#.#.###.#.#.#.###.#############.###########.#.#######.#####.#.#####.#########################.#.#.#####.#.#########.###.##### +#.#...#...#.#...#...#...#.#.#...#.....#...#...#...........#.#.#.......#.....#.......#...#...###...###...#.....#...#...#...#.......#...#.....# +#.#.#.#.#.#.#.#######.###.#.###.#####.#.#.#.#.###########.#.#.#.#######.#############.#.#.#.###.#.###.#.#.#########.#.#####.#####.###.#####.# +#...#...#.#...#...#...#...#.#...#...#...#.#.#.#...........#...#.......#.........#.....#.#.#.#...#.....#...#.........#.....#.....#.###.#.....# +#########.#####.#.#.###.###.#.###.#.#####.#.#.#.#####################.#########.#.#####.#.#.#.#############.#############.#####.#.###.#.##### +#.........#...#.#.#.###.#...#.....#.#...#...#...#...#...#...#.........#.....#...#.....#.#.#.#...#.........#...#...........#...#.#...#.#.....# +#.#########.#.#.#.#.###.#.#########.#.#.#########.#.#.#.#.#.#.#########.###.#.#######.#.#.#.###.#.#######.###.#.###########.#.#.###.#.#####.# +#.#.....#...#.#.#.#...#...#.........#.#.#.........#...#...#.#.......#...###...#...#...#...#.....#.###...#...#.#.............#.#...#...#...#.# +#.#.###.#.###.#.#.###.#####.#########.#.#.#################.#######.#.#########.#.#.#############.###.#.###.#.###############.###.#####.#.#.# +#.#...#...###...#.....###...#...#.....#...#################......S#...#...#...#.#.#.........#.....#...#.....#.#...............#...#.....#.#.# +#.###.###################.###.#.#.#####################################.#.#.#.#.#.#########.#.#####.#########.#.###############.###.#####.#.# +#...#...###...#...###.....#...#...#...#############################...#.#...#.#.#.#.....###...#...#...........#...#...###...###.#...#...#...# +###.###.###.#.#.#.###.#####.#######.#.#############################.#.#.#####.#.#.#.###.#######.#.###############.#.#.###.#.###.#.###.#.##### +#...#...#...#...#.....#...#.#.......#.#######################.......#.#.....#.#.#.#...#.#...###.#.#.............#...#.....#.....#.....#.#...# +#.###.###.#############.#.#.#.#######.#######################.#######.#####.#.#.#.###.#.#.#.###.#.#.###########.#######################.#.#.# +#.....###.......#...#...#...#.......#.#.....#################...#...#.....#.#...#.....#...#.....#.#.#.........#.........................#.#.# +###############.#.#.#.#############.#.#.###.###################.#.#.#####.#.#####################.#.#.#######.###########################.#.# +###...#...#...#...#...#.............#...#...#E###...#####...###...#.#.....#.............#.......#.#...#.......###...#...#...#...#...#...#.#.# +###.#.#.#.#.#.#########.#################.###.###.#.#####.#.#######.#.#################.#.#####.#.#####.#########.#.#.#.#.#.#.#.#.#.#.#.#.#.# +#...#...#...#.#.......#.................#.....#...#...#...#...###...#.###...#...#...###...###...#...###.....#...#.#...#.#.#...#...#...#...#.# +#.###########.#.#####.#################.#######.#####.#.#####.###.###.###.#.#.#.#.#.#########.#####.#######.#.#.#.#####.#.#################.# +#.#...#.....#...#...#...#.........#.....#.....#.#...#.#.....#.#...#...#...#.#.#.#.#.......#...#...#.........#.#.#.#.....#...#.......#...#...# +#.#.#.#.###.#####.#.###.#.#######.#.#####.###.#.#.#.#.#####.#.#.###.###.###.#.#.#.#######.#.###.#.###########.#.#.#.#######.#.#####.#.#.#.### +#.#.#.#...#.......#...#...#.....#...#...#.#...#.#.#...#...#.#.#...#...#...#.#.#...#...#...#.....#.........#...#...#.#.......#.....#.#.#.#...# +#.#.#.###.###########.#####.###.#####.#.#.#.###.#.#####.#.#.#.###.###.###.#.#.#####.#.#.#################.#.#######.#.###########.#.#.#.###.# +#.#.#.....###...###...#.....###.......#...#.....#...#...#...#...#.#...#...#.#...#...#...#.......###.......#.#.....#.#.#...#...#...#...#.....# +#.#.#########.#.###.###.###########################.#.#########.#.#.###.###.###.#.#######.#####.###.#######.#.###.#.#.#.#.#.#.#.############# +#...#...###...#.....#...###.............#.......#...#.......#...#.#...#...#.#...#.......#.....#...#...#.....#...#.#...#.#...#.#.....#...#...# +#####.#.###.#########.#####.###########.#.#####.#.#########.#.###.###.###.#.#.#########.#####.###.###.#.#######.#.#####.#####.#####.#.#.#.#.# +#.....#.....#.....#...#...#.........###.#.#...#...#.....#...#...#...#.....#...#.........#.....#...#...#.#.......#.....#.....#.#...#.#.#.#.#.# +#.###########.###.#.###.#.#########.###.#.#.#.#####.###.#.#####.###.###########.#########.#####.###.###.#.###########.#####.#.#.#.#.#.#.#.#.# +#...........#.###.#.#...#.........#...#...#.#...###...#...#.....###...........#.......#...#...#...#.....#.........###.......#...#...#.#.#.#.# +###########.#.###.#.#.###########.###.#####.###.#####.#####.#################.#######.#.###.#.###.###############.###################.#.#.#.# +###.........#.#...#.#...#...#...#.#...#...#.#...#...#.....#...#...###...#...#.#.......#.....#.#...#...#.........#.........###...###...#.#.#.# +###.#########.#.###.###.#.#.#.#.#.#.###.#.#.#.###.#.#####.###.#.#.###.#.#.#.#.#.#############.#.###.#.#.#######.#########.###.#.###.###.#.#.# +#...#...#...#.#.....###...#...#.#.#...#.#.#.#...#.#.....#.#...#.#.#...#.#.#...#.....#...#.....#...#.#.#.......#.#...#...#...#.#...#...#...#.# +#.###.#.#.#.#.#################.#.###.#.#.#.###.#.#####.#.#.###.#.#.###.#.#########.#.#.#.#######.#.#.#######.#.#.#.#.#.###.#.###.###.#####.# +#.....#...#...#...#######...#...#.....#.#.#.#...#...#...#.#.###.#.#...#.#.....#.....#.#.#.....#...#.#.###...#.#.#.#.#.#.....#.#...#...#...#.# +###############.#.#######.#.#.#########.#.#.#.#####.#.###.#.###.#.###.#.#####.#.#####.#.#####.#.###.#.###.#.#.#.#.#.#.#######.#.###.###.#.#.# +#...#...#.......#...###...#...#...#...#.#...#.#.....#.#...#...#.#...#.#.#...#.#...#...#.#...#.#...#.#.#...#...#...#.#.........#.....#...#.#.# +#.#.#.#.#.#########.###.#######.#.#.#.#.#####.#.#####.#.#####.#.###.#.#.#.#.#.###.#.###.#.#.#.###.#.#.#.###########.#################.###.#.# +#.#...#.#.....#...#...#.........#...#.#...#...#...#...#...#...#.#...#.#.#.#...#...#.#...#.#.#...#.#.#.#...........#...#...#...#...#...###...# +#.#####.#####.#.#.###.###############.###.#.#####.#.#####.#.###.#.###.#.#.#####.###.#.###.#.###.#.#.#.###########.###.#.#.#.#.#.#.#.######### +#.#...#.......#.#...#...#...###.......#...#...#...#...#...#...#.#.....#.#.....#.#...#.....#.#...#...#...#.....#...#...#.#.#.#...#.#.........# +#.#.#.#########.###.###.#.#.###.#######.#####.#.#####.#.#####.#.#######.#####.#.#.#########.#.#########.#.###.#.###.###.#.#.#####.#########.# +#.#.#...#...#...###...#...#.....#.....#.....#.#.#...#.#.....#.#.###.....#...#.#...#.........#.......#...#.###...###.....#.#.....#...#.....#.# +#.#.###.#.#.#.#######.###########.###.#####.#.#.#.#.#.#####.#.#.###.#####.#.#.#####.###############.#.###.###############.#####.###.#.###.#.# +#.#.#...#.#.#...#.....#...#.....#.###...#...#.#...#.#.#.....#...#...#...#.#.#.....#...#.......#...#.#...#.....#.........#.#...#...#...###...# +#.#.#.###.#.###.#.#####.#.#.###.#.#####.#.###.#####.#.#.#########.###.#.#.#.#####.###.#.#####.#.#.#.###.#####.#.#######.#.#.#.###.########### +#...#...#.#.....#.....#.#...###.#.....#.#...#...#...#.#.###.......#...#.#.#.#...#.#...#.#.....#.#...###.#...#...#...#...#.#.#...#...........# +#######.#.###########.#.#######.#####.#.###.###.#.###.#.###.#######.###.#.#.#.#.#.#.###.#.#####.#######.#.#.#####.#.#.###.#.###.###########.# +#.......#.#...#.......#.###.....#.....#.#...#...#.#...#...#.......#.###...#.#.#...#.....#.....#.......#.#.#.#...#.#...###.#...#.#...........# +#.#######.#.#.#.#######.###.#####.#####.#.###.###.#.#####.#######.#.#######.#.###############.#######.#.#.#.#.#.#.#######.###.#.#.########### +#.#.......#.#.#.......#.#...#...#...#...#.#...#...#...#...#.......#...#.....#...........#.....#...#...#...#.#.#.#.#...#...#...#.#...........# +#.#.#######.#.#######.#.#.###.#.###.#.###.#.###.#####.#.###.#########.#.###############.#.#####.#.#.#######.#.#.#.#.#.#.###.###.###########.# +#...#.......#.........#.#...#.#...#.#.#...#.#...#...#.#...#.#...#...#.#...#...#...#...#.#.#...#.#...#...#...#.#.#...#.#.....###.....#.....#.# +#####.#################.###.#.###.#.#.#.###.#.###.#.#.###.#.#.#.#.#.#.###.#.#.#.#.#.#.#.#.#.#.#.#####.#.#.###.#.#####.#############.#.###.#.# +#.....#...#...........#...#...#...#.#.#.#...#...#.#...#...#.#.#.#.#.#...#.#.#...#.#.#...#...#.#.....#.#.#.#...#.#...#...........###...#...#.# +#.#####.#.#.#########.###.#####.###.#.#.#.#####.#.#####.###.#.#.#.#.###.#.#.#####.#.#########.#####.#.#.#.#.###.#.#.###########.#######.###.# +#.#...#.#.#.#.........#...###...#...#.#.#.#...#.#...#...###...#.#.#.#...#.#...#...#.#.........#.....#.#.#...#...#.#...#...#...#.......#.....# +#.#.#.#.#.#.#.#########.#####.###.###.#.#.#.#.#.###.#.#########.#.#.#.###.###.#.###.#.#########.#####.#.#####.###.###.#.#.#.#.#######.####### +#...#...#...#.........#.#.....#...#...#.#...#...###.#.....###...#.#.#...#...#.#...#.#.....#...#.......#.....#.#...#...#.#.#.#...#...#.......# +#####################.#.#.#####.###.###.###########.#####.###.###.#.###.###.#.###.#.#####.#.#.#############.#.#.###.###.#.#.###.#.#.#######.# +#.....................#.#...#...###...#.#...#.......#...#...#.#...#...#.#...#...#.#...###...#...#...#...#...#.#...#...#.#.#...#.#.#.#.....#.# +#.#####################.###.#.#######.#.#.#.#.#######.#.###.#.#.#####.#.#.#####.#.###.#########.#.#.#.#.#.###.###.###.#.#.###.#.#.#.#.###.#.# +#.........#...#...#...#.###.#...#.....#...#.#.....#...#.#...#.#.....#.#.#...#...#.#...#.........#.#...#.#...#.#...#...#.#.#...#.#.#...###.#.# +#########.#.#.#.#.#.#.#.###.###.#.#########.#####.#.###.#.###.#####.#.#.###.#.###.#.###.#########.#####.###.#.#.###.###.#.#.###.#.#######.#.# +#.........#.#...#...#.#.#...#...#.......#...#.....#...#.#...#.#.....#.#.#...#...#.#...#.#.......#.....#.#...#...###...#.#.#.#...#.......#.#.# +#.#########.#########.#.#.###.#########.#.###.#######.#.###.#.#.#####.#.#.#####.#.###.#.#.#####.#####.#.#.###########.#.#.#.#.#########.#.#.# +#.....#.....#.........#.#.#...#.........#.#...#...#...#.#...#.#.....#.#.#.......#.#...#...#.....#.....#.#.....#...#...#.#.#.#...#.......#.#.# +#####.#.#####.#########.#.#.###.#########.#.###.#.#.###.#.###.#####.#.#.#########.#.#######.#####.#####.#####.#.#.#.###.#.#.###.#.#######.#.# +#.....#.#.....#...#...#.#.#...#.#...#...#.#.#...#.#.#...#.#...#...#.#.#.....#.....#.....#...#...#.....#.#...#...#.#...#.#.#.#...#.......#.#.# +#.#####.#.#####.#.#.#.#.#.###.#.#.#.#.#.#.#.#.###.#.#.###.#.###.#.#.#.#####.#.#########.#.###.#.#####.#.#.#.#####.###.#.#.#.#.#########.#.#.# +#.......#.......#...#...#.....#...#...#...#...###...#.....#.....#...#.......#...........#.....#.......#...#.......###...#...#...........#...# +############################################################################################################################################# diff --git a/2024/day20/main.go b/2024/day20/main.go new file mode 100644 index 0000000..e631d4d --- /dev/null +++ b/2024/day20/main.go @@ -0,0 +1,53 @@ +package main + +import ( + "fmt" + + h "git.bullercodeworks.com/brian/adventofcode/helpers" +) + +func main() { + inp := h.StdinToStringSlice() + solve(inp) +} + +var ( + N = h.Coordinate{X: 0, Y: -1} + E = h.Coordinate{X: 1, Y: 0} + S = h.Coordinate{X: 0, Y: 1} + W = h.Coordinate{X: -1, Y: 0} + Dirs = []h.Coordinate{N, E, S, W} +) + +func solve(inp []string) { + m := h.StringSliceToCoordByteMap(inp) + start, _ := m.FindFirst('S') + // Find the path through the map + queue, dist := []h.Coordinate{start}, map[h.Coordinate]int{start: 0} + for len(queue) > 0 { + p := queue[0] + queue = queue[1:] + for _, d := range Dirs { + n := p.Add(d) + if _, ok := dist[n]; !ok && m.Get(n) != '#' { + queue, dist[n] = append(queue, n), dist[p]+1 + } + } + } + part1, part2 := 0, 0 + for p1 := range dist { + for p2 := range dist { + d := p1.Distance(p2) + if d <= 20 && dist[p2] >= dist[p1]+d+100 { + if d <= 2 { + part1++ + } + part2++ + } + } + } + fmt.Println("# Part 1") + fmt.Println(part1) + fmt.Println("\n# Part 2") + fmt.Println(part2) +} diff --git a/2024/day20/testinput b/2024/day20/testinput new file mode 100644 index 0000000..c097dae --- /dev/null +++ b/2024/day20/testinput @@ -0,0 +1,15 @@ +############### +#...#...#.....# +#.#.#.#.#.###.# +#S#...#.#.#...# +#######.#.#.### +#######.#.#...# +#######.#.###.# +###..E#...#...# +###.#######.### +#...###...#...# +#.#####.#.###.# +#.#...#.#.#...# +#.#.#.#.#.#.### +#...#...#...### +###############