{"ScriptPreparationCode":"function createString(length) {\r\n var result = \u0027\u0027;\r\n var characters = \u0027ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\u0027;\r\n var charactersLength = characters.length;\r\n for (let i = 0; i \u003C length; i\u002B\u002B ) {\r\n result \u002B= characters.charAt(Math.floor(Math.random() * charactersLength));\r\n }\r\n return result;\r\n}\r\nlet length = 500\r\nvar randomWord1 = createString(length)\r\nvar randomWord2 = createString(length)\r\n\r\nvar bestWord1 = \u0027a\u0027\r\nvar bestWord2 = \u0027a\u0027\r\n\r\nvar badWord1 = (\u0027a\u0027.repeat(length) \u002B \u0027g\u0027)\r\nvar badWord2 = (\u0027x\u0027.repeat(length) \u002B \u0027g\u0027)\r\n\r\nfunction checkMap(string1, string2) {\r\n let seenMap = new Map()\r\n for(let letter of string1) {\r\n if(!seenMap.has(letter)) {\r\n if(string2.includes(letter)) return \u0022YES\u0022\r\n seenMap.set(letter, true)\r\n }\r\n }\r\n return \u0022NO\u0022\r\n}\r\nfunction checkSearch(string1,string2){\r\n for(let letter of string1){\r\n if(string2.search(string1.substring(letter))!=-1){\r\n return \u0022YES\u0022;\r\n }\r\n }\r\n return \u0022NO\u0022;\r\n}\r\nfunction checkIncludes(string1,string2){\r\n for(let letter of string1) {\r\n if(string2.includes(letter))return \u0022YES\u0022;\r\n }\r\n return \u0022NO\u0022;\r\n}","TestCases":[{"Name":"Map- best","Code":"checkMap(bestWord1, bestWord2)","IsDeferred":false},{"Name":"Search- best","Code":"checkSearch(bestWord1, bestWord2)","IsDeferred":false},{"Name":"Includes -best","Code":"checkIncludes(bestWord1, bestWord2)","IsDeferred":false},{"Name":"Map - random","Code":"checkMap(randomWord1, randomWord1)","IsDeferred":false},{"Name":"Search- random","Code":"checkSearch(randomWord1, randomWord1)","IsDeferred":false},{"Name":"Includes- random","Code":"checkIncludes(randomWord1, randomWord1)","IsDeferred":false},{"Name":"Map -bad","Code":"checkMap(badWord1, badWord2)","IsDeferred":false},{"Name":"Search-bad","Code":"checkSearch(badWord1, badWord2)","IsDeferred":false},{"Name":"Includes -bad","Code":"checkIncludes(badWord1, badWord2)","IsDeferred":false}]}