Skip to content

Commit f80761a

Browse files
Update 0300.最长上升子序列.md
result should be initialized to 1.
1 parent f7e280e commit f80761a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

problems/0300.最长上升子序列.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ class Solution:
149149
if len(nums) <= 1:
150150
return len(nums)
151151
dp = [1] * len(nums)
152-
result = 0
152+
result = 1
153153
for i in range(1, len(nums)):
154154
for j in range(0, i):
155155
if nums[i] > nums[j]:

0 commit comments

Comments
 (0)