core: contest: detail fix

This commit is contained in:
undefined committed 2021-10-26 15:00:07 +08:00
1 parent 7e8a90a6b2
commit a988445597
10 files changed
+10 -31

No files matched your search

+3 -6
View File
@@ -130,12 +130,9 @@ Set.union = function Union<T>(setA: Set<T>, setB: Set<T>) {
return union;
};
Set.intersection = function Intersection<T>(setA: Set<T>, setB: Set<T>): Set<T> {
const intersection = new Set();
for (const elem of setB) {
if (setA.has(elem)) intersection.add(elem);
}
// @ts-ignore
Set.intersection = function Intersection<T>(setA: Set<T>, setB: Set<T>) {
const intersection = new Set<T>();
for (const elem of setB) if (setA.has(elem)) intersection.add(elem);
return intersection;
};