{"ScriptPreparationCode":"var data = [2, 5, 4, 6, 3, 7, 8, 4, 6, 1, 6, 2, 8, 8, 7, 6];\r\nvar blockLength = 3;","TestCases":[{"Name":"Lodash Range","Code":"const numBlocks = data.length - blockLength \u002B 1;\r\n\r\nconst minPerBlock = _.range(0, numBlocks).map((i) =\u003E\r\n Math.min(...data.slice(i, i \u002B blockLength))\r\n);\r\n\r\nconst maxOfMins = Math.max(...minPerBlock);\r\n\r\nconsole.log(minPerBlock);\r\nconsole.log(maxOfMins);","IsDeferred":false},{"Name":"For Loop","Code":"const numBlocks = data.length - blockLength \u002B 1;\r\nconst minPerBlock = [];\r\n\r\nfor (let i = 0; i \u003C numBlocks; \u002B\u002Bi) {\r\n const block = data.slice(i, i \u002B blockLength);\r\n minPerBlock.push(Math.min(...block));\r\n}\r\n\r\nconst maxOfMins = Math.max(...minPerBlock);\r\n\r\nconsole.log( minPerBlock )\r\nconsole.log( maxOfMins )","IsDeferred":false},{"Name":"Map","Code":"const minPerBlock = [...data].map((v, idx, self) =\u003E {\r\n return self.length \u003E idx\u002B(blockLength-1) ? self.slice(idx, idx \u002B blockLength) : undefined;\r\n}).filter((v)=\u003E v !== undefined).map((group)=\u003E Math.min(...group) );\r\nconst maxOfMins = Math.max(...minPerBlock);\r\n\r\nconsole.log( minPerBlock )\r\nconsole.log( maxOfMins )","IsDeferred":false}]}