Skip to content

Commit 51cb616

Browse files
committed
Alternative
1 parent a622d65 commit 51cb616

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@
2626
|[22](https://adventofcode.com/2020/day/22)|Crab Combat|[py](/day22/main.py)|
2727
|[23](https://adventofcode.com/2020/day/23)|Crab Cups|[py](/day23/main.py)|
2828
|[24](https://adventofcode.com/2020/day/24)|Lobby Layout|[py](/day24/main.py)|
29-
|[25](https://adventofcode.com/2020/day/25)|Combo Breaker|[py](/day25/main.py)|
29+
|[25](https://adventofcode.com/2020/day/25)|Combo Breaker|[py](/day25/main.py), [alt](/day25/alt.py)|

day25/alt.py

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
with open("input.txt") as f:
2+
pub1, pub2 = [int(x) for x in f]
3+
4+
n = 1
5+
loop_size = 0
6+
while n != pub2:
7+
n = (n * 7) % 20201227
8+
loop_size += 1
9+
10+
print(pow(pub1, loop_size, 20201227))

0 commit comments

Comments
 (0)