-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsolution.py
executable file
·75 lines (51 loc) · 1.35 KB
/
solution.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
"""
Part 1
------
TODO: write something here
Part 2
------
TODO: write something here
"""
import os
import re
import sys
from dataclasses import dataclass
from typing import Dict, List, Tuple
from aoc import utils
from aoc.utils import dprint, to_numbers
DAY = 'DD' # TODO
DEBUG = int(os.environ.get('DEBUG', 0))
def solve_part_1(fname: str):
res = solve_p1(load_input(fname))
print(res)
def solve_part_2(fname: str):
res = solve_p2(load_input(fname))
print(res)
def load_input(fname: str = None):
"""
Load input from given file (or input.txt by default)
using task specific parser/line_parser
"""
# TODO: fix loading parameters if necessary
return utils.load_input(fname, line_parser=parse)
def parse(line: str) -> str:
"""Parse a line of input into suitable data structure:
"""
# TODO: implement or delete if no transformation is needed
return line
def solve_p1(lines: List[str]) -> int:
"""Solution to the 1st part of the challenge"""
return 0
def solve_p2(lines: List[str]) -> int:
"""Solution to the 2nd part of the challenge"""
return 0
tests = [
# (load_input('test.1.txt'), exp1, None),
# TODO
]
reals = [
# (load_input(), None, None)
]
if __name__ == '__main__':
utils.run_tests(DAY, tests, solve_p1, solve_p2)
utils.run_real(DAY, reals, solve_p1, solve_p2)