Skip to content

Commit 4570e98

Browse files
committed
Fix while loop condition in helper to correctly iterates
1 parent 994ee9f commit 4570e98

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sprint-2/improve_with_caches/making_change/making_change.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def ways_to_make_change_helper(total: int, coin_index :int) -> int:
2626

2727
coin = coins[coin_index]
2828
count_of_coin = 0
29-
while count_of_coin * count_of_coin <= total:
29+
while count_of_coin * coin <= total:
3030
ways += ways_to_make_change_helper(
3131
total - count_of_coin * coin,
3232
coin_index + 1

0 commit comments

Comments
 (0)