def stones(pile,moves):
results=[False]+[True]*pile
for count in range(1,pile+1):
possible=[x for x in moves if count-x>=0]
results[count]= not(all(results[count-i] for i in possible))
if results[pile]:
return 2
else:
return 1
why does it not work?
Created at: 2019/04/03 17:52; Updated at: 2019/04/04 09:00