We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9b76ea9 commit 5ac3e0cCopy full SHA for 5ac3e0c
examples/factoradic.py
@@ -33,10 +33,10 @@ def int_to_factoradic(num: int) -> str:
33
34
start = Stream.counting(1).take_while(lambda n: factorial(n) <= num).last()
35
36
- digits: list[int] = [
+ digits = (
37
num // f + (num := num % f) // f
38
for f in Stream.range(start, stop=0, step=-1).map(factorial)
39
- ]
+ )
40
41
return Stream(digits).map(DIGITS.__getitem__).collect("".join)
42
0 commit comments