corrected small coin change error

master
Evan Hemsley 2015-12-18 19:57:08 -08:00
parent e364cffdbf
commit f7af5044bd
1 changed files with 3 additions and 3 deletions

View File

@ -3,10 +3,10 @@ def change(n, list_of_coins)
end
def change_helper(n, list_of_coins, result_list)
if list_of_coins.empty?
return []
elsif n == 0
if n == 0
return [result_list]
elsif list_of_coins.empty?
return []
else
list_of_coins.each do |coin|
if n < coin