parameters: (self, widths, S)
return_statement: return result
docstring: :type widths: List[int]
          :type S: str
          :rtype: List[int]
docstring_summary: :type widths: List[int]
          :type S: str
          :rtype: List[int]
docstring_tokens: : type widths : List [ int ] : type S : str : rtype : List [ int ]
function: def numberOfLines(self, widths, S):
          """
          :type widths: List[int]
          :type S: str
          :rtype: List[int]
          """
          result = [1, 0]
          for c in S:
              w = widths[ord(c)-ord('a')]
              result[1] += w
              if result[1] > 100:
                  result[0] += 1
                  result[1] = w
          return result
function_tokens: def numberOfLines ( self , widths , S ) : result = [ 1 , 0 ] for c in S : w = widths [ ord ( c ) - ord ( 'a' ) ] result [ 1 ] += w if result [ 1 ] > 100 : result [ 0 ] += 1 result [ 1 ] = w return result