day1.a
This commit is contained in:
parent
88c338c73b
commit
018ebf6eaa
20
day1a/__main__.py
Normal file
20
day1a/__main__.py
Normal file
|
@ -0,0 +1,20 @@
|
|||
with open("./day1a/inputs.txt", "r") as file:
|
||||
inputs = file.read().strip().split()
|
||||
|
||||
value = sum(
|
||||
map(
|
||||
lambda nums: int(
|
||||
"".join([nums[0], nums[-1]]),
|
||||
)
|
||||
if len(nums) >= 2
|
||||
else int(
|
||||
"".join(nums * 2),
|
||||
),
|
||||
map(
|
||||
lambda text: [c for c in text if c.isdigit()],
|
||||
inputs,
|
||||
),
|
||||
)
|
||||
)
|
||||
|
||||
print(f"{value=}")
|
1000
day1a/inputs.txt
Normal file
1000
day1a/inputs.txt
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue