Skip to content

Commit

Permalink
[2024/11] tidy up split()
Browse files Browse the repository at this point in the history
  • Loading branch information
StarlitGhost committed Dec 11, 2024
1 parent 16cbdda commit ac8a16a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions 2024/11/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ def num_digits(value: int) -> int:

@cache
def split(value: int) -> tuple[int, int]:
digits = num_digits(value)
tens_place = 10 ** (digits//2)
tens_place = 10 ** (num_digits(value) // 2)
l_value = value // tens_place
r_value = value - (l_value * tens_place)
return (l_value, r_value)
Expand Down

0 comments on commit ac8a16a

Please sign in to comment.