Jump Game(C++)
class Solution {
public:
bool isJumpable = false;
bool canJump(vector<int>& nums) {
int distance = 0;
for(vector<int>::iterator it = nums.end() - 1 ; it >= nums.begin(); it--,distance++){
if(*it >= distance){
distance = 0;
}
if(it == nums.begin() && *it >= distance)
return true;
}
return false;
}
};
相關文章
- Jump-gameGAM
- [LeetCode] 55. Jump GameLeetCodeGAM
- [LeetCode] 45. Jump Game IILeetCodeGAM
- 55-jump Game 跳躍遊戲GAM遊戲
- 【Leetcode】1340. Jump Game V 【動態規劃/記憶性搜尋】LeetCodeGAM動態規劃
- 【leetcode】45. Jump Game II 非負陣列的最少跳躍步數LeetCodeGAM陣列
- 12、C++ Switch的使用問題error: jump to case labelC++Error
- CF1768F Wonderful Jump 題解
- Guessing GameGAM
- Wooden GameGAM
- Shop GameGAM
- Card GameGAM
- 《JUMP》中最強的好女人角色排行TOP 10
- Fast Car GameASTGAM
- Infinite Card GameGAM
- game development -- flowGAMdev
- LeetCode 403 Frog Jump 青蛙過河 Javascirpt 解決方案LeetCodeJava
- FZU 2275 Game (KMP)GAMKMP
- Switch Game HDU - 2053GAM
- HDU 1729 Stone GameGAM
- C. Game MasterGAMAST
- E. Wooden GameGAM
- C. Game on PermutationGAM
- D. Shop GameGAM
- This is the easiest to observe during the gameGAM
- Dragon Tiger Cattle Cattle GameGoGAM
- C. MEX Game 1GAM
- Shooter Game User Interface StarterGAM
- D. Soldier and Number GameGAM
- Game Jam與椰島GAM
- Leetcode 292. Nim GameLeetCodeGAM
- TGDC | Evolving AAA Game DevelopmentGAMdev
- 都說自己玩的是dead game,但究竟誰才是真的dead game?GAM
- CF2006A Iris and Game on the TreeGAM
- Codeforces_943_D_Permutation GameGAM
- 【博弈論】HDU - 7216 Triangle GameGAM
- Lecture 02 Layered Architecture of Game EngineGAM
- wordle game 猜字遊戲GAM遊戲