Solve 2025-08

This commit is contained in:
2025-12-08 14:09:00 +01:00
parent 63a7a93aba
commit 5421fde574
6 changed files with 119 additions and 1 deletions
+7
View File
@@ -135,6 +135,13 @@ export function uniqueCombinations<E>(arr: ReadonlyArray<E>): { a: E; b: E }[] {
arr.flatMap((b, bI) => (a !== b && aI > bI ? [{ a, b }] : []))
);
}
export function uniqueIndexCombinations<E>(
arr: ReadonlyArray<E>
): { aI: number; bI: number }[] {
return arr.flatMap((a, aI) =>
arr.flatMap((b, bI) => (a !== b && aI > bI ? [{ aI, bI }] : []))
);
}
/**
* Returns a filter lambda to be used in array.filter() to only allow the