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

Function solution

project_euler/problem_031/sol1.py:48–61  ·  view source on GitHub ↗

Returns the number of different ways can n pence be made using any number of coins? >>> solution(500) 6295434 >>> solution(200) 73682 >>> solution(50) 451 >>> solution(10) 11

(n: int = 200)

Source from the content-addressed store, hash-verified

46
47
48def solution(n: int = 200) -> int:
49 """Returns the number of different ways can n pence be made using any number of
50 coins?
51
52 >>> solution(500)
53 6295434
54 >>> solution(200)
55 73682
56 >>> solution(50)
57 451
58 >>> solution(10)
59 11
60 """
61 return two_pound(n)
62
63
64if __name__ == "__main__":

Callers 1

sol1.pyFile · 0.70

Calls 1

two_poundFunction · 0.85

Tested by

no test coverage detected