<doocs>0673.Number of Longest Increasing Subsequence_1.py
def findNumberOfLIS( nums: List[int]) -> int:
    maxLen, ans, n = 0, 0, len(nums)
    dp, cnt = [1] * n, [1] * n
    for i in range(n):
        for j in range(i):
            if nums[i] > nums[j]:
                if dp[j] + 1 > dp[i]:
                    dp[i] = dp[j] + 1
                    cnt[i] = cnt[j]
                elif dp[j] + 1 == dp[i]:
                    cnt[i] += cnt[j]
        if dp[i] > maxLen:
            maxLen = dp[i]
            ans = cnt[i]
        elif dp[i] == maxLen:
            ans += cnt[i]
    return ans
def sample_funcname ( var_0 : List [ int ] ) -> int :
    var_4 , var_5 , var_7 = 0 , 0 , len ( var_0 )
    var_9 , var_10 = [ 1 ] * var_7 , [ 1 ] * var_7
    for var_12 in range ( var_7 ) :
        for var_13 in range ( var_12 ) :
            if var_0 [ var_12 ] > var_0 [ var_13 ] :
                if var_9 [ var_13 ] + 1 > var_9 [ var_12 ] :
                    var_9 [ var_12 ] = var_9 [ var_13 ] + 1
                    var_10 [ var_12 ] = var_10 [ var_13 ]
                elif var_9 [ var_13 ] + 1 == var_9 [ var_12 ] :
                    var_10 [ var_12 ] += var_10 [ var_13 ]
        if var_9 [ var_12 ] > var_4 :
            var_4 = var_9 [ var_12 ]
            var_5 = var_10 [ var_12 ]
        elif var_9 [ var_12 ] == var_4 :
            var_5 += var_10 [ var_12 ]
    return var_5
