<doocs>0977.Squares of a Sorted Array_1.py
def sortedSquares( nums: List[int]) -> List[int]:
    n = len(nums)
    res = [0] * n
    i, j, k = 0, n - 1, n - 1
    while i <= j:
        if nums[i] * nums[i] > nums[j] * nums[j]:
            res[k] = nums[i] * nums[i]
            i += 1
        else:
            res[k] = nums[j] * nums[j]
            j -= 1
        k -= 1
    return res
def sample_funcname ( var_0 : List [ int ] ) -> List [ int ] :
    var_4 = len ( var_0 )
    var_6 = [ 0 ] * var_4
    var_7 , var_9 , var_10 = 0 , var_4 - 1 , var_4 - 1
    while var_7 <= var_9 :
        if var_0 [ var_7 ] * var_0 [ var_7 ] > var_0 [ var_9 ] * var_0 [ var_9 ] :
            var_6 [ var_10 ] = var_0 [ var_7 ] * var_0 [ var_7 ]
            var_7 += 1
        else :
            var_6 [ var_10 ] = var_0 [ var_9 ] * var_0 [ var_9 ]
            var_9 -= 1
        var_10 -= 1
    return var_6
