Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.

Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).

def lengthOfLIS(self, nums): if not nums: return 0 dp=[1]*len(nums) for i in range(len(nums)): for j in range(i): if nums[j]<nums[i] and dp[j]+1>dp[i]: dp[i]=dp[j]+1 return max(dp)

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.