add 2024/day11
This commit is contained in:
parent
3cb912f1a7
commit
f5c0c4d52f
1 changed files with 6 additions and 4 deletions
|
@ -19,12 +19,14 @@ def blink(stone: str) -> list:
|
||||||
return [1]
|
return [1]
|
||||||
|
|
||||||
if len(str(stone)) % 2 == 0:
|
if len(str(stone)) % 2 == 0:
|
||||||
|
# split stone
|
||||||
middle = len(str(stone)) // 2
|
middle = len(str(stone)) // 2
|
||||||
first = str(stone)[:middle]
|
tens = 10**middle
|
||||||
second = str(stone)[middle:]
|
first = stone // tens
|
||||||
return [int(first), int(second)]
|
second = stone % tens
|
||||||
|
return [first, second]
|
||||||
|
|
||||||
return [int(stone) * 2024]
|
return [stone * 2024]
|
||||||
|
|
||||||
|
|
||||||
def solve(stones: dict) -> dict:
|
def solve(stones: dict) -> dict:
|
||||||
|
|
Loading…
Reference in a new issue