Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for The Stones by mildm
def stones(pile, moves):
m,r=sorted(moves),[0]*(pile+1)
for n in range(1,pile+1):
if n<=m[0]: r[n]=2
else: r[n]=3-max(r[n-i] for i in m if n>i)
return r[-1]
Nov. 5, 2023
Comments: