<doocs>0264.Ugly Number II_1.py
def nthUglyNumber( n: int) -> int:
    dp = [1] * n
    p2 = p3 = p5 = 0
    for i in range(1, n):
        next2, next3, next5 = dp[p2] * 2, dp[p3] * 3, dp[p5] * 5
        dp[i] = min(next2, next3, next5)
        if dp[i] == next2:
            p2 += 1
        if dp[i] == next3:
            p3 += 1
        if dp[i] == next5:
            p5 += 1
    return dp[n - 1]
def sample_funcname ( var_0 : int ) -> int :
    var_3 = [ 1 ] * var_0
    var_7 = var_4 = var_5 = 0
    for var_9 in range ( 1 , var_0 ) :
        var_11 , var_13 , var_15 = var_3 [ var_7 ] * 2 , var_3 [ var_4 ] * 3 , var_3 [ var_5 ] * 5
        var_3 [ var_9 ] = min ( var_11 , var_13 , var_15 )
        if var_3 [ var_9 ] == var_11 :
            var_7 += 1
        if var_3 [ var_9 ] == var_13 :
            var_4 += 1
        if var_3 [ var_9 ] == var_15 :
            var_5 += 1
    return var_3 [ var_0 - 1 ]
