mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-08 16:54:50 +08:00
Update 0300.最长上升子序列.md
最新力扣新增测试案例 nums = [0] 预期输出 1 实际输出 0 就是nums.length == 0 时 要return 1
This commit is contained in:
@ -130,7 +130,7 @@ public:
|
||||
class Solution {
|
||||
public int lengthOfLIS(int[] nums) {
|
||||
int[] dp = new int[nums.length];
|
||||
int res = 0;
|
||||
int res = 1;
|
||||
Arrays.fill(dp, 1);
|
||||
for (int i = 1; i < dp.length; i++) {
|
||||
for (int j = 0; j < i; j++) {
|
||||
|
Reference in New Issue
Block a user