Skip to content

Commit 08b6aa2

Browse files
committed
Completed day 25 of year 2015
1 parent b6ad331 commit 08b6aa2

2 files changed

Lines changed: 24 additions & 2 deletions

File tree

2015/24.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1+
from functools import cache
2+
13
split_data = lambda data: sorted([int(x) for x in data.split('\n')], reverse=True)
24
completed = True
35
raw_data = None # Not To be touched
46

5-
from functools import cache
6-
77
def part1(data):
88
aim = sum(data) // 3
99

2015/25.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
4+
import re
5+
6+
split_data = False
7+
completed = 1
8+
raw_data = None # Not To be touched
9+
10+
def part1(data):
11+
row, col = re.search(r"To continue, please consult the code grid in the manual. Enter the code at row (\d+), column (\d+).", data).groups()
12+
r, c = int(row), int(col)
13+
n = ((r + c - 2) * (r + c - 1)) // 2 + c
14+
15+
code = 20151125
16+
for _ in range(1, n):
17+
code = (code * 252533) % 33554393
18+
19+
return code
20+
21+
def part2(data):
22+
...

0 commit comments

Comments
 (0)