12 lines
310 B
Python
12 lines
310 B
Python
def parse(filename: str) -> list[list[int]]:
|
|
elves = []
|
|
elf = []
|
|
with open(filename, "r") as f:
|
|
while line := f.readline():
|
|
if line == "\n":
|
|
elves.append(elf)
|
|
elf = []
|
|
else:
|
|
elf.append(int(line[:-1]))
|
|
return elves
|