corrected small coin change error
parent
e364cffdbf
commit
f7af5044bd
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue