checkio进不去,代码vs测试通过应该没问题。暂且保留记录。等待更新
import copy
def checkio(price, denominations):
l=len(denominations)
a=denominations
b=[price]
p=1
k=0
while(max(b)>=min(denominations)):
for i in b:
if i in denominations:
k=1
break
if k ==1 :
break
p+=1
c=copy.deepcopy(b)
b=[]
for i in c:
for j in a:
b.append(i-j)
if k==0:
return None
else:
return p