Apply greedy strategy similarly to solve the 'jump game II' problem.