-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.py
43 lines (29 loc) · 1.04 KB
/
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
43
import sys
import os
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
from lib import lib
INPUT_FILE = os.path.join(os.path.dirname(__file__), 'input.txt')
TEST_FILE = os.path.join(os.path.dirname(__file__), 'test.txt')
def parse_data(content: str):
'''Parses the data'''
return content.splitlines()
def silver(content: str, debug: bool = False):
'''Solves the silver problem'''
data = parse_data(content)
return 0
def gold(content: str, debug: bool = False):
'''Solves the gold problem'''
data = parse_data(content)
return 0
def main():
'''Parses the input and solves the two problems'''
options = lib.parse_args()
content = lib.read_file(TEST_FILE)
print(f"Silver test: {silver(content, debug=True)}")
print(f"Gold test: {gold(content, debug=True)}")
if not options.debug:
content = lib.read_file(INPUT_FILE)
print(f"Silver: {silver(content)}")
print(f"Gold: {gold(content)}")
if __name__ == "__main__":
main()