A really tough one! I misinterpreted part of the lore where it says “-40 degrees” and for like 3 minutes thought I will have to type on a rotated keypad :D
This day's part2 was the first time this year that I couldn't do it in one sitting. I had to relax a bit and do something else bc it broke my brain :D Definitely the hardest one so far
Using some inspiration from memoized solutions on reddit i basically had `static long cheapestMove(int start, int end, int upstreamRobots, int deadzone)` which generates the ways to move from start to end index, ignoring deadzone, and finds the min of those by calling a helper method(String sequence, int upstream) which recursively invokes the cheapestMove for each move in the sequence. And cheapestMove memoizes the result of all 4 args.
This one sure made my head hurt a lot, it took me wayyyyyy to long to realise the shortest sequence for any N robot doesn't matter if it doesn't produce the shortest sequence of another later one..
That’s a critical piece. There are so many sequences that look equivalent lengthwise but aren’t because all but one screw you over when you’re generating a robot’s input earlier in the chain.
i have solved it but took me several hours... my solution for part 1 was very sub-optimal and i had to come up with a different approach for part 2. not happy with this day but at least solved
A really tough one! I misinterpreted part of the lore where it says “-40 degrees” and for like 3 minutes thought I will have to type on a rotated keypad :D
Yea some of the stuff I don’t know why they bolded
World class thumbnail
This day's part2 was the first time this year that I couldn't do it in one sitting. I had to relax a bit and do something else bc it broke my brain :D Definitely the hardest one so far
Using some inspiration from memoized solutions on reddit i basically had `static long cheapestMove(int start, int end, int upstreamRobots, int deadzone)` which generates the ways to move from start to end index, ignoring deadzone, and finds the min of those by calling a helper method(String sequence, int upstream) which recursively invokes the cheapestMove for each move in the sequence. And cheapestMove memoizes the result of all 4 args.
HAHA, you can tell from thumbnail if Neil had an easy time with the problem or not😂
This one sure made my head hurt a lot, it took me wayyyyyy to long to realise the shortest sequence for any N robot doesn't matter if it doesn't produce the shortest sequence of another later one..
That’s a critical piece. There are so many sequences that look equivalent lengthwise but aren’t because all but one screw you over when you’re generating a robot’s input earlier in the chain.
i have solved it but took me several hours... my solution for part 1 was very sub-optimal and i had to come up with a different approach for part 2.
not happy with this day but at least solved