Untitled
Anonymous
plain_text
01/20/2023 3:24 PM
384 B
18
Indexable
def rec_sum(s,coin):
if s==0:
print("Finish")
return True
if s<0 : return False
for _ in coin:
if rec_sum(s - _, coin):
return True
return False
if __name__ == '__main__':
coin = set([7,3])
print(rec_sum(11,coin))Editor is loading...