Calculate the number of non-bouncy numbers with at most n digits. >>> non_bouncy_upto(1) 9 >>> non_bouncy_upto(6) 12951 >>> non_bouncy_upto(10) 277032
(n: int)
| 48 | |
| 49 | |
| 50 | def non_bouncy_upto(n: int) -> int: |
| 51 | """ |
| 52 | Calculate the number of non-bouncy numbers with at most n digits. |
| 53 | >>> non_bouncy_upto(1) |
| 54 | 9 |
| 55 | >>> non_bouncy_upto(6) |
| 56 | 12951 |
| 57 | >>> non_bouncy_upto(10) |
| 58 | 277032 |
| 59 | """ |
| 60 | return sum(non_bouncy_exact(i) for i in range(1, n + 1)) |
| 61 | |
| 62 | |
| 63 | def solution(num_digits: int = 100) -> int: |
no test coverage detected