{"ScriptPreparationCode":"var from = new Set();\r\nvar match1 = new Set();\r\nvar match2 = new Set();\r\nvar match3 = new Set();\r\nvar mismatch1 = new Set();\r\nvar mismatch2 = new Set();\r\nvar mismatch3 = new Set();\r\n\r\nfor (let i = 0; i \u003C 1000; i\u002B\u002B) {\r\n from.add(i);\r\n match1.add(i);\r\n match2.add(i);\r\n match3.add(i);\r\n mismatch1.add(1000 \u002B i);\r\n mismatch2.add(2000 \u002B i);\r\n mismatch3.add(3000 \u002B i);\r\n}\r\n\r\nfunction setsUnion(sets) {\r\n if (sets.length === 1) {\r\n return sets[0];\r\n }\r\n\r\n const result = new Set();\r\n for (let i = 0; i \u003C sets.length; i\u002B\u002B) {\r\n for (const value of sets[i]) {\r\n result.add(value);\r\n }\r\n }\r\n\r\n return result;\r\n};\r\n\r\nfunction setsDifferenceModify(from, sets) {\r\n for (const value of from) {\r\n for (let i = 0; i \u003C sets.length; i\u002B\u002B) {\r\n if (sets[i].has(value)) {\r\n from.delete(value);\r\n break;\r\n }\r\n }\r\n }\r\n}","TestCases":[{"Name":"difference(from, [a, b, c]) - match","Code":"setsDifferenceModify(from, [match1, match2, match3]);","IsDeferred":false},{"Name":"difference(from, [a, b, c]) - mismatch","Code":"setsDifferenceModify(from, [mismatch1, mismatch2, mismatch3]);","IsDeferred":false},{"Name":"difference(from, [union(a, b, c)]) - match","Code":"setsDifferenceModify(from, [setsUnion(match1, match2, match3)]);","IsDeferred":false},{"Name":"difference(from, [union(a, b, c)]) - mismatch","Code":"setsDifferenceModify(from, [setsUnion(mismatch1, mismatch2, mismatch3)]);","IsDeferred":false}]}