Skip to content

Commit 668a160

Browse files
committed
TIL update
1 parent ea9b30d commit 668a160

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ We can refactor it to be more concise:
6969
Alternatively, we can use `defaultdict` from `collections`, which automatically provides a default value for the key that doesn't exist.
7070

7171

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+
7277
## Day 10
7378
[![meme from day 10](/memes/day_10.png)](https://www.reddit.com/r/adventofcode/comments/1hbbtdd/2024_day_10/)
7479

0 commit comments

Comments
 (0)