Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
dynamic programming solution in Clear category for The Stones by David_Jones
def stones(pile, moves):
results = [2] * pile
for i in range(1, pile):
if any(i - move >= 0 and results[i - move] == 2 for move in moves):
results[i] = 1
return results[-1]
May 8, 2019
Comments: