getInput variant, that only returns integers from input lines
This commit is contained in:
parent
c2f6191d69
commit
89edb0a6d7
@ -207,6 +207,12 @@ class AOCDay:
|
||||
else:
|
||||
return self.input.copy()
|
||||
|
||||
def getIntsFromInput(self) -> list:
|
||||
if len(self.input) == 1:
|
||||
return list(map(int, re.findall(r"-?\d+", self.input[0])))
|
||||
else:
|
||||
return [list(map(int, re.findall(r"-?\d+", l))) for l in self.input]
|
||||
|
||||
def getMultiLineInputAsArray(
|
||||
self, return_type: Type = None, join_char: str = None
|
||||
) -> List:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user