from typing import List, Tuple class RucksackLoader: def __init__(self, path: str): self.path = path def parse_file(self) -> List[Tuple[List[str], List[str]]]: rucksacks = [] with open(self.path, "r") as file: for line in file: line = line.strip() if len(line) == 0: continue comp_1 = list(line[:len(line)//2]) comp_2 = list(line[len(line)//2:]) rucksacks.append((comp_1, comp_2)) return rucksacks