LeetCode OJ Jump Game II
来源:互联网 发布:微信淘口令淘宝打不开 编辑:程序博客网 时间:2024/05/15 23:54
class Solution {public: int jump(int A[], int n) { int * step = new int[n]; step[0] = 0; int pos = 1; for (int i = 0; i < n; i++) { int j; for (j = pos; j <= A[i] + i && j < n; j++) { step[j] = step[i] + 1; } pos = j; } int ans = step[n - 1]; delete []step; return ans; }};
0 0
- LeetCode OJ:Jump Game II
- LeetCode OJ - Jump Game II
- LeetCode OJ Jump Game II
- LeetCode OJ:Jump Game
- LeetCode OJ - Jump Game
- LeetCode: Jump Game II
- LeetCode Jump Game II
- LeetCode: Jump Game II
- [Leetcode] Jump Game II
- [LeetCode] Jump Game II
- [Leetcode] Jump Game ii
- leetcode Jump Game II
- leetcode Jump Game II
- [LeetCode]Jump Game II
- [leetcode]Jump Game II
- LeetCode-Jump Game II
- [leetcode] Jump Game II
- LeetCode - Jump Game II
- C++类和动态内存分配
- LeetCode OJ Wildcard Matching
- UVa 11488 Hyper Prefix Sets(字典树)
- LeetCode OJ Permutations II
- OC学习小结之protocol
- LeetCode OJ Jump Game II
- 当初我未嫁,你未娶。你干什么去了?
- LeetCode OJ Permutations
- LeetCode OJ Combination Sum II
- LeetCode OJ Combination Sum
- 我对编程的理解
- MongoDB nagios check_mongodb插件监控
- LeetCode OJ Maximum Subarray
- Android开发学习笔记:浅谈显示Intent和隐式Intent