DP practice — 1340. Jump Game V

Problem statement: