getCommonPrefix = (items) => {
  let prefix = items[0];

  for (let i = 1; i < items.length; i++) {
    const item = items[i];
    for (let p = 0; p < prefix.length; p++) {
      if (item[p] !== prefix[p]) {
        prefix = prefix.slice(0, p);
        break;
      }
    }
  }

  return prefix;
}
@param {Array<string>} items items
@returns {string} common prefix