code: def _build_index(self):
          row0 = list(map(len, self._lists))
          if len(row0) == 1:
              self._index[:] = row0
              self._offset = 0
              return
          head = iter(row0)
          tail = iter(head)
          row1 = list(starmap(add, zip(head, tail)))
          if len(row0) & 1:
              row1.append(row0[-1])
          if len(row1) == 1:
              self._index[:] = row1 + row0
              self._offset = 1
              return
          size = 2 ** (int(log_e(len(row1) - 1, 2)) + 1)
          row1.extend(repeat(0, size - len(row1)))
          tree = [row0, row1]
          while len(tree[-1]) > 1:
              head = iter(tree[-1])
              tail = iter(head)
              row = list(starmap(add, zip(head, tail)))
              tree.append(row)
          reduce(iadd, reversed(tree), self._index)
          self._offset = size * 2 - 1