-
Notifications
You must be signed in to change notification settings - Fork 1
/
template.py
42 lines (27 loc) · 836 Bytes
/
template.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
#!/usr/bin/env python3
from os.path import dirname, realpath, join
import time
def transform_input(input_):
input_ = input_.strip()
# custom transform for the day
return input_
def read_input():
dir_path = dirname(realpath(__file__))
with open(join(dir_path, "input.txt"), "r") as f:
for line in f:
yield transform_input(line)
def solve_part1(input_):
pass
def solve_part2(input_):
pass
def main():
start_time = time.time()
solve_part1(read_input())
elapsed_time = (time.time() - start_time) * 1e3
print(f"Time elapsed for part 1: {elapsed_time} ms")
start_time = time.time()
solve_part2(read_input())
elapsed_time = (time.time() - start_time) * 1e3
print(f"Time elapsed for part 2: {elapsed_time} ms")
if __name__ == "__main__":
main()