101 - Jump Game II - Dynamic Programming approach 1

Pseudo code: // int[] nums int level = 0, left = 0, right = 0; while (right is less than ( - 1)) { int farthest = 0; for (int i = left; i is less than or equal to right; i ) { farthest = MAX(farthest, i nums[i]); } left = right 1; right = farthest; level ; } return level; Leetcode: Github:
Back to Top