{"ScriptPreparationCode":null,"TestCases":[{"Name":"Set","Code":"const str = \u0027Hello world nice to meet you hello again world\u0027;\r\nconsole.log(\u0027unique words:\u0027, [...new Set(str.toLowerCase().split(/\\s\u002B/))]);","IsDeferred":false},{"Name":"Lookup","Code":"const str = \u0027Hello world nice to meet you hello again world\u0027;\r\nconst words = {};\r\nfor ( const word of str.toLowerCase().split(/\\s\u002B/)) {\r\n words[word] = word;\r\n}\r\nconsole.log(\u0027unique words:\u0027, Object.keys(words));","IsDeferred":false},{"Name":"filter","Code":"const str = \u0027Hello world nice to meet you hello again world\u0027;\r\nconsole.log(\u0027unique words:\u0027,str.toLowerCase().split(/\\s\u002B/).filter((v, i, m) =\u003E i === m.indexOf(v)));","IsDeferred":false},{"Name":"lookup let","Code":"const str = \u0027Hello world nice to meet you hello again world\u0027;\r\nconst words = {};\r\nfor ( let word of str.toLowerCase().split(/\\s\u002B/)) {\r\n words[word] = word;\r\n}\r\nconsole.log(\u0027unique words:\u0027, Object.keys(words));","IsDeferred":false},{"Name":"regex","Code":" const str = \u0027Hello world nice to meet you hello again world\u0027;\r\nconsole.log(\u0027unique words:\u0027,str.replace(/(\\b\\S.\u002B\\b)(?=.*\\1)/g, \u0022\u0022).trim());","IsDeferred":false}]}