Fmars Blog
Inner happiness comes from self-sacrifice
My Blog List
[Leetcode Solution] Jump Game
Analysis
Simply maintain two variables p and q representing the current position and the farthest position where can be reached seperately.
Iterate the p if p<=q, and update q if the further place can be reached from the p
Note
Code
No comments:
Post a Comment
Enter you comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Enter you comment