comefrom: <doocs>0738.Monotone Increasing Digits_1.py
code: def monotoneIncreasingDigits( n: int) -> int:
      s = list(str(n))
      i = 1
      while i < len(s) and s[i - 1] <= s[i]:
          i += 1
      if i < len(s):
          while i and s[i - 1] > s[i]:
              s[i - 1] = str(int(s[i - 1]) - 1)
              i -= 1
          i += 1
          while i < len(s):
              s[i] = '9'
              i += 1
      return int(''.join(s))
masked: def sample_funcname ( var_0 : int ) -> int :
      var_4 = list ( str ( var_0 ) )
      var_6 = 1
      while var_6 < len ( var_4 ) and var_4 [ var_6 - 1 ] <= var_4 [ var_6 ] :
          var_6 += 1
      if var_6 < len ( var_4 ) :
          while var_6 and var_4 [ var_6 - 1 ] > var_4 [ var_6 ] :
              var_4 [ var_6 - 1 ] = str ( int ( var_4 [ var_6 - 1 ] ) - 1 )
              var_6 -= 1
          var_6 += 1
          while var_6 < len ( var_4 ) :
              var_4 [ var_6 ] = '9'
              var_6 += 1
      return int ( ''.join ( var_4 ) )
  