Light Mode
Dark Mode
what is wrong?
    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: April 3, 2019, 5:52 p.m.
Updated: April 4, 2019, 9 a.m.
0
8
User avatar
Atsushi_Sakata