未验证 提交 584707f3 编写于 作者: K Keqi Huang 提交者: GitHub

Update 045._Jump_Game_II.md

上级 2f47964e
......@@ -11,11 +11,11 @@ Easy
思路
# greedy solution, the current jump is ```[i, cur_end]```, and the ```cur_farthest``` is the farthest point
# that all of point in ```[i, cur_end]``` can reach, whenever ```cur_farthest``` is larger than the last point' index,
# return current ```jump+1```; whenever ```i``` reaches ```cur_end```, update ```cur_end``` to ```current cur_farthest```.
# Time: O(log(n))
# Space: O(1)
greedy solution, the current jump is ```[i, cur_end]```, and the ```cur_farthest``` is the farthest point
that all of point in ```[i, cur_end]``` can reach, whenever ```cur_farthest``` is larger than the last point' index,
return current ```jump+1```; whenever ```i``` reaches ```cur_end```, update ```cur_end``` to ```current cur_farthest```.
- Time: O(log(n))
- Space: O(1)
```python
class Solution(object):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册