You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,6 +69,11 @@ We can refactor it to be more concise:
69
69
Alternatively, we can use `defaultdict` from `collections`, which automatically provides a default value for the key that doesn't exist.
70
70
71
71
72
+
## Day 09
73
+
In part two, I got rid of `OrderedDict` since I hadn't actually used it in part one anyway.
74
+
To improve performance, I changed the structure from `index: file_id` to `file_id: [list of indices]`, as searching through the old dictionary was painfully slow.
75
+
I also replaced the while loop with a for loop (always a pleasure) 😇
76
+
72
77
## Day 10
73
78
[](https://www.reddit.com/r/adventofcode/comments/1hbbtdd/2024_day_10/)
0 commit comments