40 lines
808 B
Python
40 lines
808 B
Python
|
import re
|
||
|
from string import ascii_lowercase, ascii_uppercase
|
||
|
|
||
|
EXAMPLE = """
|
||
|
"""
|
||
|
|
||
|
def clean(text: str) -> list[str]:
|
||
|
return list(filter(lambda l: l.strip() != "", text.splitlines()))
|
||
|
|
||
|
def solve(lines: list[str]):
|
||
|
res = 0
|
||
|
for i, line in enumerate(lines):
|
||
|
print(i, line)
|
||
|
return res
|
||
|
|
||
|
def solve2(lines: list[str]):
|
||
|
res = 0
|
||
|
for i, line in enumerate(lines):
|
||
|
print(i, line)
|
||
|
return res
|
||
|
|
||
|
def main():
|
||
|
example = clean(EXAMPLE)
|
||
|
print("Example 1:", solve(example))
|
||
|
return
|
||
|
|
||
|
data = clean(open("i6.txt").read())
|
||
|
print("Solution 1:", solve(data))
|
||
|
return
|
||
|
|
||
|
example = clean(EXAMPLE)
|
||
|
print("Example 2:", solve2(example))
|
||
|
return
|
||
|
|
||
|
data = clean(open("i6.txt").read())
|
||
|
print("Solution 2:", solve2(data))
|
||
|
|
||
|
if __name__ == "__main__":
|
||
|
main()
|