mirror of
https://github.com/cupcakearmy/advent-of-code.git
synced 2025-12-14 05:44:59 +00:00
move to 2020 fodler
This commit is contained in:
16
2020/solutions/3/README.md
Normal file
16
2020/solutions/3/README.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# 3
|
||||
|
||||
We can simply parse the forest as an array of strings.
|
||||
The trees repeat infinitely to the right, this screams for a good mod.
|
||||
This means: `char = row[x % len(row)]`. No complex logic needed
|
||||
|
||||
For the second one we simply automate the process and sum up the total.
|
||||
We can simply encode the coordinates as a function of the index we are current at.
|
||||
|
||||
<details>
|
||||
<summary>Solutions</summary>
|
||||
<ol>
|
||||
<li>252</li>
|
||||
<li>57 * 252 * 64 * 66 * 43 = 2608962048</li>
|
||||
</ol>
|
||||
</details>
|
||||
Reference in New Issue
Block a user