filmov
tv
Leetcode 55.Jump Game (Java)

Показать описание
6:04
My mistake - I said it wrong but I wrote correctly.
The order actually matters - Fail checking should come first.
In our example 1 3 2 1 0 1 2 1, in the iteration after the number 0, we meet the condition to update the ‘furthest’ pointer (which shouldn't), and it will not go into fail checking if statement, giving us the wrong answer.
Not a tutorial. Just documentation of my personal study.
If you wanna watch this, set the play speed to 1.5x.
My mistake - I said it wrong but I wrote correctly.
The order actually matters - Fail checking should come first.
In our example 1 3 2 1 0 1 2 1, in the iteration after the number 0, we meet the condition to update the ‘furthest’ pointer (which shouldn't), and it will not go into fail checking if statement, giving us the wrong answer.
Not a tutorial. Just documentation of my personal study.
If you wanna watch this, set the play speed to 1.5x.