Update 0300.最长上升子序列.md

result should be initialized to 1.
This commit is contained in:
JaneyLin
2023-05-02 23:34:57 -04:00
committed by GitHub
parent f7e280e7e2
commit f80761a438

View File

@ -149,7 +149,7 @@ class Solution:
if len(nums) <= 1:
return len(nums)
dp = [1] * len(nums)
result = 0
result = 1
for i in range(1, len(nums)):
for j in range(0, i):
if nums[i] > nums[j]: