advent-of-code/2022/13/README.md

16 lines
552 B
Markdown
Raw Normal View History

2022-12-13 13:49:51 +01:00
# 13
Back to easy mode for now.
So i used the `json` parse method to parse the input. No need to write our own parser. From there recursion if your friend and if you simply implement the rules you get to part 1 quickly.
Part 2 was also straight forward. Instead of returning `True` or `False`, just return `-1, 0, 1`, add the `[[2]]` and `[[6]]` into the lines and use the built sort algorithm with your comparator from part 1 and you're done.
<details>
<summary>Solutions</summary>
<ol>
<li>6101</li>
<li>21909</li>
</ol>
</details>