标签:turn col break style ++ public jump game code div
class Solution { public: bool canJump(vector<int>& nums) { int length = nums.size(); bool can[length]; for(int i = 1;i < length;i++) can[i] = false; can[0] = true; for(int i = 1;i < length;i++){ for(int j = i-1;j >= 0;j--){ if(can[j] == true && nums[j] >= i-j){ can[i] = true; break; } } } return can[length-1]; } };
标签:turn col break style ++ public jump game code div
原文地址:http://www.cnblogs.com/ymjyqsx/p/7468001.html