aiming for speed, my code is a mess. might rewrite later idk
--------Part 1-------- --------Part 2--------
Day Time Rank Score Time Rank Score
18 03:53:35 7931 0 - - -
17 15:13:29 12295 0 16:41:39 11982 0
16 03:49:07 8446 0 03:56:58 7801 0
15 02:57:42 13196 0 03:13:28 10135 0
14 02:07:11 9436 0 02:22:43 5515 0
13 >24h 28656 0 >24h 24460 0
12 01:36:46 6016 0 04:45:49 4521 0
11 01:57:45 10019 0 02:09:18 8986 0
10 00:42:49 2556 0 >24h 28843 0
9 00:15:16 2709 0 00:16:48 1887 0
8 00:07:04 1060 0 02:03:22 8950 0
7 00:21:09 1094 0 01:42:22 7213 0
6 01:40:00 15657 0 01:40:55 14673 0
5 00:19:58 1328 0 02:20:35 5145 0
4 00:03:20 188 0 00:14:51 1145 0
3 01:08:04 7722 0 01:16:06 5682 0
2 00:15:38 3080 0 00:18:33 2440 0
1 00:02:03 219 0 00:08:05 173 0
- Fast (but not fast enough)
- Read too fast and missed the "mulpiple rounds per game, seperated by ';'" point, and then also typoed 'g'->'b'. Part 2 was <2 minutes once I got part 1 though
- Didn't handle end of line case correctly (was only processing numbers after seeing a non-numeric symbol) and then overcomplicated things worrying about
+
and-
signs. Once figured out, decently fast part 2 - Fast (but not fast enough) part 1 , but then used array index instead of Game ID in initial part 2 implementation, which was wrong and delayed me a bit
- Tedious problem. Incredible innefficent part 1, so did a complete rewrite for part 2
- Late start due to life - actual time taken around 3:30 for part 1, 4:30 for part 2 (but I got some thinking time). Classic easy puzzle, part 1 solution Just Worked for part 2
- TIL that Python3 deprecates
cmp
and also thatkey
is faster and cleaner. Part 1 was straightforward but I was a bit slow. I tried to be too smart and count unique cards to figure out rankings quickly, but that got too messy for part 2, so I stopped, had breakfast, and rewrote it a little more cleanlygit - Fun, classic problem. Good part 1 (generally worked, I was just typing a bit slow), and then a part 2 that's intractable without some Math, which I did after breakfast/dropping the kids off
- Fun again. Decent part 1 but didn't work first time(I incorrectly tested sum(sequence)==0 to see if they were all 0, which doesn't work), and then part 2 was trivial
- Took the wrong approach (didn't use recursion!) and got stuck for a bit, but ended with a clean recursive solution for part 1. Part 2: was stuck on this for a while trying and failing at counting crossings. Attacked it afresh today and figured out a clean solution with clever counting!
- Started late on this one because I was out late last night. Fun problem, initial solution was clean but needed a 'sparse' method for Part 2, which I did by tracking rows that needed expanding and taking them into account with the distance function
- Almost got part 1 it before breakfast but had a bug. I thought I had a relatively efficient solution, but part 2 proved me wrong and I rewrote using a cache and generally avoiding string traversals and got something that runs in under 5 seconds
- Did this a day late, once again sleeping on it helped resolve bugs. Vewry inneffient solutiobn, did not expect part 2 to work, but it was fine (well under a second), probably because it was lots of small grids rather than one big one.
- Used sorting of substrings to do the falling rocks, cute and worked surprisingly well. For Part 2, just looked at the output and figured it out
- Pretty straightforward; no specific optmization needed
- Expected part 2 to be slow, but brute-force 'try every possible entry point' was good enough
- Big Sunday problem, pain in the butt to get working quickly (especially part 2) and had very buggy code, but eventually stuck a priority queue in there and it worked very quickly