MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / solution

Function solution

project_euler/problem_092/sol1.py:83–98  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

81
82
83def 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
101if __name__ == "__main__":

Callers 1

sol1.pyFile · 0.70

Calls 2

chainFunction · 0.85
countMethod · 0.80

Tested by

no test coverage detected