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 + numsi); left right + 1; right farthest; level++; return level; Time complexity: O(n) Space complexity: O(1) Leetcode: Github:
0
0
Related videos
Preparing
To view the site materials you should be more than or equal to 18 years old