Skip to content

Commit

Permalink
Update 0300.最长上升子序列.md
Browse files Browse the repository at this point in the history
最新力扣新增测试案例
nums = [0] 预期输出 1 实际输出 0
就是nums.length == 0 时 要return 1
  • Loading branch information
hlp777 authored Dec 5, 2023
1 parent f47dd60 commit a18bca3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion problems/0300.最长上升子序列.md
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down

0 comments on commit a18bca3

Please sign in to comment.