Amazon Interview Question

Hopscotch game related Coding question (Dynamic Programming)