code: def diff_xIndex(self, diffs, loc):
      
      chars1 = 0
      chars2 = 0
      last_chars1 = 0
      last_chars2 = 0
      for x in range(len(diffs)):
        (op, text) = diffs[x]
        if op != self.DIFF_INSERT:  # Equality or deletion.
          chars1 += len(text)
        if op != self.DIFF_DELETE:  # Equality or insertion.
          chars2 += len(text)
        if chars1 > loc:  # Overshot the location.
          break
        last_chars1 = chars1
        last_chars2 = chars2
  
      if len(diffs) != x and diffs[x][0] == self.DIFF_DELETE:
        # The location was deleted.
        return last_chars2
      # Add the remaining len(character).
      return last_chars2 + (loc - last_chars1)
docs: loc is a location in text1, compute and return the equivalent location
      in text2.  e.g. "The cat" vs "The big cat", 1->1, 5->8
  
      Args:
        diffs: Array of diff tuples.
        loc: Location within text1.
  
      Returns:
        Location within text2.