MCPcopy Index your code
hub / github.com/TheAlgorithms/Python / solution

Function solution

project_euler/problem_053/sol1.py:27–40  ·  view source on GitHub ↗

Returns the number of values of nCr, for 1 ≤ n ≤ 100, are greater than one-million >>> solution() 4075

()

Source from the content-addressed store, hash-verified

25
26
27def solution():
28 """Returns the number of values of nCr, for 1 ≤ n ≤ 100, are greater than
29 one-million
30
31 >>> solution()
32 4075
33 """
34 total = 0
35
36 for i in range(1, 101):
37 for j in range(1, i + 1):
38 if combinations(i, j) > 1e6:
39 total += 1
40 return total
41
42
43if __name__ == "__main__":

Callers 1

sol1.pyFile · 0.70

Calls 1

combinationsFunction · 0.70

Tested by

no test coverage detected