{"ScriptPreparationCode":"function generateRecords(count) {\r\n const records = [];\r\n for (let i = 1; i \u003C= count; i\u002B\u002B) {\r\n // \u0413\u0435\u043D\u0435\u0440\u0430\u0446\u0438\u044F \u0441\u043B\u0443\u0447\u0430\u0439\u043D\u043E\u0433\u043E original.id (\u043E\u0442 1 \u0434\u043E count/2 \u0434\u043B\u044F \u043F\u043E\u044F\u0432\u043B\u0435\u043D\u0438\u044F \u0434\u0443\u0431\u043B\u0438\u043A\u0430\u0442\u043E\u0432)\r\n const originalId = Math.floor(Math.random() * (count / 2)) \u002B 1;\r\n records.push({ id: i, original: { id: originalId } });\r\n }\r\n return records;\r\n}\r\n\r\n\r\nfunction getUniqueRecords (records) {\r\n const seenIds = [];\r\n const uniqueRecords = [];\r\n\r\n for (const record of records) {\r\n if (!seenIds.includes(record.original.id)) {\r\n seenIds.push(record.original.id);\r\n uniqueRecords.push(record);\r\n }\r\n }\r\n\r\n return uniqueRecords;\r\n}\r\n\r\nfunction getUniqueRecordsSet(records) {\r\n const seenIds = new Set();\r\n const uniqueRecords = [];\r\n\r\n for (const record of records) {\r\n if (!seenIds.has(record.original.id)) {\r\n seenIds.add(record.original.id);\r\n uniqueRecords.push(record);\r\n }\r\n }\r\n\r\n return uniqueRecords;\r\n}\r\n\r\nfunction getUniqueRecords3(records) {\r\n const uniqueRecords = [];\r\n const seenIds = new Set();\r\n\r\n for (const record of records) {\r\n if (!seenIds.has(record.original.id)) {\r\n seenIds.add(record.original.id);\r\n uniqueRecords.push(record.original);\r\n }\r\n }\r\n\r\n return uniqueRecords;\r\n }\r\n\r\nvar records = generateRecords(1000)\r\n\r\n","TestCases":[{"Name":"list","Code":"getUniqueRecords(records)","IsDeferred":false},{"Name":"set","Code":"getUniqueRecordsSet(records)","IsDeferred":false},{"Name":"gpt","Code":"getUniqueRecords3(records)","IsDeferred":false}]}