Myvideo

Guest

Login

103 - Jump Game II - Final DP solution in Java

Uploaded By: Myvideo
1 view
0
0 votes
0

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; Time complexity: O(n) Space complexity: O(1) Leetcode: Github:

Share with your friends

Link:

Embed:

Video Size:

Custom size:

x

Add to Playlist:

Favorites
My Playlist
Watch Later