mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-18 18:14:34 +08:00
Modernize Python 2 code to get ready for Python 3
This commit is contained in:
@ -5,6 +5,7 @@ Can you determine number of ways of making change for n units using
|
||||
the given types of coins?
|
||||
https://www.hackerrank.com/challenges/coin-change/problem
|
||||
"""
|
||||
from __future__ import print_function
|
||||
def dp_count(S, m, n):
|
||||
table = [0] * (n + 1)
|
||||
|
||||
@ -21,5 +22,5 @@ def dp_count(S, m, n):
|
||||
return table[n]
|
||||
|
||||
if __name__ == '__main__':
|
||||
print dp_count([1, 2, 3], 3, 4) # answer 4
|
||||
print dp_count([2, 5, 3, 6], 4, 10) # answer 5
|
||||
print(dp_count([1, 2, 3], 3, 4)) # answer 4
|
||||
print(dp_count([2, 5, 3, 6], 4, 10)) # answer 5
|
||||
|
Reference in New Issue
Block a user