55. Jump Game
来源:互联网 发布:mysql怎么取消主键 编辑:程序博客网 时间:2024/05/01 10:11
Given an array of non-negative integers, you are initially positioned at the first index of the array.
Each element in the array represents your maximum jump length at that position.
Determine if you are able to reach the last index.
For example:
A = [2,3,1,1,4]
, return true
.
A = [3,2,1,0,4]
, return false
.
bool canJump(vector<int>& nums) { int n = nums.size(); int res = 0; int i = 0; while (i < n&&i<=res) { res = max(i + nums[i], res); i++; } return res>=n-1;}
0 0
- 55. Jump Game && 45. Jump Game II
- 55. Jump Game. 45. Jump Game II
- [LeetCode]55.Jump Game
- LeetCode 55.Jump Game
- LeetCode --- 55. Jump Game
- [Leetcode] 55. Jump Game
- [leetcode] 55.Jump Game
- 55. Jump Game
- 55. Jump Game
- [leetcode] 55.Jump Game
- *LeetCode 55. Jump Game
- LeetCode 55. Jump Game
- [leetcode] 55. Jump Game
- 55. Jump Game
- leetcode 55. Jump Game
- 55. Jump Game LeetCode
- 【LeetCode】55. Jump Game
- 55. Jump Game
- TestDisk, Data Recovery—分区恢复—文件恢复
- (OK) mkisofs——in linux
- O2O商业模式剖析
- Skype—set font size —in CentOS/Fedora/RHEL—修改Skype字体大小
- nginx—fastcgi—FCGX_Accept_r failed with error code: -88—in CentOS7
- 55. Jump Game
- UI设计中ID软件书籍排版时目录的制作你会吗?【太原UI设计师】分享
- nginx—fastcgi—Writing Hello World in FCGI with C++—in CentOS7
- (OK) 运行cBPM—CentOS7
- C++读取文件夹中特定后缀的文件—dirent—vector
- corethink功能模块探索开发(十)前台显示公告列表
- paper4—Multi-MPE_Trigger_Algorithm—temp
- POJ 3034 DP
- iOS开发学习笔记——分段视图(UISegmentedControl)