Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
As simple as it gets (maybe..) solution in Clear category for The Stones by dan_rue
def stones(pile, moves):
piles = [True] * (pile + 1)
for i in range(1, pile + 1):
piles[i] = any(not piles[i - move] for move in moves if i - move >= 0)
return (2, 1)[piles[-1]]
March 25, 2024