class Solution:
    def lengthOfLIS(self, nums: List[int]) -> int:
        if len(nums) in [0, 1]:
            return len(nums)
        dp = [1 for _ in range(len(nums))]
        for i in range(len(nums)):
            for j in range(i):
                if nums[j]<nums[i]:
                    dp[i]=max(dp[i], dp[j]+1)
        return max(dp)
    
            
