parameters: (self, S)
return_statement: return result
docstring: :type S: str
          :rtype: List[int]
docstring_summary: :type S: str
          :rtype: List[int]
docstring_tokens: : type S : str : rtype : List [ int ]
function: def diStringMatch(self, S):
          """
          :type S: str
          :rtype: List[int]
          """
          result = []
          left, right = 0, len(S)
          for c in S:
              if c == 'I':
                  result.append(left)
                  left += 1
              else:
                  result.append(right)
                  right -= 1
          result.append(left)
          return result
function_tokens: def diStringMatch ( self , S ) : result = [ ] left , right = 0 , len ( S ) for c in S : if c == 'I' : result . append ( left ) left += 1 else : result . append ( right ) right -= 1 result . append ( left ) return result