Advent of Code 2024 - Day 5

https://adventofcode.com

This is a thread to discuss Day 5 :slight_smile:

https://adventofcode.com/2024/day/5

REMEMBER!
It is VERY important NOT to write any public spoilers :slight_smile:
ALWAYS keep spoiler stuff hidden inside one of these

Summary

This text will be hidden

which you can obtain by clicking on the gear icon

image

Good luck :slight_smile:
FYI one of the features of Advent of Code is that we all get given different inputs so our answers will be different.
The examples are all the same but each of us gets different inputs for us to solve

Part 1 done - wasn't too bad

For Part 2 I'm going for the brute force approach to find correct page order so leaving it running in another browser window
[edit]Brute force approach crashed by browser after 2 hours so I put a bit of brain effort in and now got it working :slight_smile:

https://snap.berkeley.edu/snap/snap.html#present:Username=cymplecy&ProjectName=aoc2024_05&editMode

Link corrected - thanks @sathvikrias

here is my very long solution:

part1

advent of code 2024 script pic(2)

Eh… I’ll finish p2 tomorrow.
p2:

Summary