':type nums: List[int]
:rtype: int'

def lengthOfLIS(self, nums):

    dp = []
    for i in xrange(len(nums)):
        dp.append(1)
        for j in xrange(i):
            if (nums[j] < nums[i]):
                dp[i] = max(dp[i], (dp[j] + 1))
    return (max(dp) if dp else 0)
