docs: function isFlatRingClosed(positions, size, startIndex, endIndex) {
    for (let i = 0; i < size; i++) {
      if (positions[startIndex + i] !== positions[endIndex - size + i]) {
        return false;
      }
    }
    return true;
  }