comefrom: <doocs>0942.DI String Match_1.py
code: def diStringMatch( s: str) -> List[int]:
      n = len(s)
      low, high = 0, n
      ans = []
      for i in range(n):
          if s[i] == 'I':
              ans.append(low)
              low += 1
          else:
              ans.append(high)
              high -= 1
      ans.append(low)
      return ans
masked: def sample_funcname ( var_0 : str ) -> List [ int ] :
      var_5 = len ( var_0 )
      var_7 , var_8 = 0 , var_5
      var_9 = [ ]
      for var_11 in range ( var_5 ) :
          if var_0 [ var_11 ] == 'I' :
              var_9.append ( var_7 )
              var_7 += 1
          else :
              var_9.append ( var_8 )
              var_8 -= 1
      var_9.append ( var_7 )
      return var_9
  