mirror of
https://hub.njuu.cf/TheAlgorithms/Python.git
synced 2023-10-11 13:06:12 +08:00
Bring problem_30 solution in line with project style guidelines (#2896)
This commit is contained in:
parent
edf2cd2b0c
commit
a56e548264
@ -31,6 +31,9 @@ def digitsum(s: str) -> int:
|
|||||||
return i if i == int(s) else 0
|
return i if i == int(s) else 0
|
||||||
|
|
||||||
|
|
||||||
|
def solution() -> int:
|
||||||
|
return sum(digitsum(str(i)) for i in range(1000, 1000000))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
count = sum(digitsum(str(i)) for i in range(1000, 1000000))
|
print(solution())
|
||||||
print(count) # --> 443839
|
|
Loading…
x
Reference in New Issue
Block a user