<doocs>0670.Maximum Swap_1.py
def maximumSwap( num: int) -> int:
    chars = list(str(num))
    n = len(chars)
    for i in range(n - 1):
        mx = i + 1
        for j in range(i + 1, n):
            if ord(chars[j]) >= ord(chars[mx]):
                mx = j
        if ord(chars[i]) < ord(chars[mx]):
            chars[i], chars[mx] = chars[mx], chars[i]
            break
    return int(''.join(chars))
def sample_funcname ( var_0 : int ) -> int :
    var_4 = list ( str ( var_0 ) )
    var_6 = len ( var_4 )
    for var_9 in range ( var_6 - 1 ) :
        var_10 = var_9 + 1
        for var_11 in range ( var_9 + 1 , var_6 ) :
            if ord ( var_4 [ var_11 ] ) >= ord ( var_4 [ var_10 ] ) :
                var_10 = var_11
        if ord ( var_4 [ var_9 ] ) < ord ( var_4 [ var_10 ] ) :
            var_4 [ var_9 ] , var_4 [ var_10 ] = var_4 [ var_10 ] , var_4 [ var_9 ]
            break
    return int ( ''.join ( var_4 ) )
