diff --git a/aoc.py b/aoc.py index af9ecb9..ed2cc38 100644 --- a/aoc.py +++ b/aoc.py @@ -96,7 +96,7 @@ class AOCDay: return return_array - def getInputAsArraySplit(self, split_char: str = ',', return_type: Type = None) -> List: + def getInputAsArraySplit(self, split_char: str = ',', return_type: Union[Type, List[Type]] = None) -> List: """ get input for day x with the lines split by split_char if input has only one line, returns a 1d array with the values @@ -139,5 +139,7 @@ def splitLine(line, split_char=',', return_type=None): if return_type is None: return line + elif isinstance(return_type, list): + return [return_type[x](i) if len(return_type) > x else i for x, i in enumerate(line)] else: return [return_type(i) for i in line]