export function sameSet(a: number[], b: number[]): boolean { if (a.length !== b.length) return false; const sortedA = [...a].sort((x, y) => x - y); const sortedB = [...b].sort((x, y) => x - y); return sortedA.every((value, i) => value === sortedB[i]); }