Solves the problem for n_digits number of digits. >>> solution(2) 45 >>> solution(10) 21838806
(n_digits: int = 20)
| 49 | |
| 50 | |
| 51 | def solution(n_digits: int = 20) -> int: |
| 52 | """ |
| 53 | Solves the problem for n_digits number of digits. |
| 54 | |
| 55 | >>> solution(2) |
| 56 | 45 |
| 57 | >>> solution(10) |
| 58 | 21838806 |
| 59 | """ |
| 60 | cache: dict[str, int] = {} |
| 61 | return solve(digit=n_digits, prev1=0, prev2=0, sum_max=9, first=True, cache=cache) |
| 62 | |
| 63 | |
| 64 | if __name__ == "__main__": |