feat: 2025-10-28打卡

This commit is contained in:
asahi
2025-10-28 01:43:48 +08:00
parent 3c203342a5
commit fc82d7eb10
4 changed files with 114 additions and 0 deletions

23
55.jump-game.java Normal file
View File

@@ -0,0 +1,23 @@
/*
* @lc app=leetcode id=55 lang=java
*
* [55] Jump Game
*/
// @lc code=start
class Solution {
public boolean canJump(int[] nums) {
int cur = 0;
for(int i=0;i<nums.length;i++) {
if(i > cur) {
return false;
}
if(nums[i]>0) {
cur = Math.max(cur, i+nums[i]);
}
}
return true;
}
}
// @lc code=end