The function returns the number of integers that end up being 89 in each chain. The function accepts a range number and the function checks all the values under value number. >>> solution(100) 80 >>> solution(10000000) 8581146
(number: int = 10000000)
| 81 | |
| 82 | |
| 83 | def solution(number: int = 10000000) -> int: |
| 84 | """ |
| 85 | The function returns the number of integers that end up being 89 in each chain. |
| 86 | The function accepts a range number and the function checks all the values |
| 87 | under value number. |
| 88 | |
| 89 | >>> solution(100) |
| 90 | 80 |
| 91 | >>> solution(10000000) |
| 92 | 8581146 |
| 93 | """ |
| 94 | for i in range(1, number): |
| 95 | if CHAINS[i] is None: |
| 96 | chain(i + 1) |
| 97 | |
| 98 | return CHAINS[:number].count(False) |
| 99 | |
| 100 | |
| 101 | if __name__ == "__main__": |