def coin_combos(goal, unit_list):
    if goal == 0:
        return [[0] * len(unit_list)]
if len(unit_list) == 0:
    return []
unit = unit_list[0]
unit_list2 = unit_list[1:]
max_cnt = goal // unit
return [([i] + s) for i in range(max_cnt + 1) for s in coin_combos(goal - i *
    unit, unit_list2)]
Coins all combinations - strange difference between 2 algorithms