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:
|
else:
|
||||||
return self.input.copy()
|
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(
|
def getMultiLineInputAsArray(
|
||||||
self, return_type: Type = None, join_char: str = None
|
self, return_type: Type = None, join_char: str = None
|
||||||
) -> List:
|
) -> List:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user