• What's wrong in my code for the Stones?

 

def stones(pile, moves):

results = [True] + [False] * pile
for count in range(1, pile + 1):
    possible = [x for x in moves if count - x >= 0]
    results[count] = not any(results[count - i] for i in possible)

return 1 if results[-1]==True else 2

if name == 'main': print("Example:") print(stones(17, [1, 3, 4]))

#These "asserts" using only for self-checking and not necessary for auto-testing
#assert stones(17, [1, 3, 4]) == 2
assert stones(17, [1, 3, 4, 6, 9]) == 1
#assert stones(99, [1]) == 2