{"ScriptPreparationCode":"var arr = [];\r\nfor (var i = 0; i \u003C 100; i\u002B\u002B) {\r\n arr.push(i);\r\n}","TestCases":[{"Name":"moving array","Code":"var range = [];\r\nfor (var i = 0; i \u003C arr.length; i\u002B\u002B) {\r\n range.push(arr[i]);\r\n\r\n if (range.length \u003E 9) {\r\n range.splice(0, 1);\r\n }\r\n \r\n if (i \u003E 8)\r\n {var avg = range.reduce(function(accu, next){ return accu \u002B next ;}) / 9;}\r\n}","IsDeferred":false},{"Name":"slice","Code":"for (var i = 0; i \u003C arr.length; i\u002B\u002B) {\r\n if (i \u003C 9) continue;\r\n var range = arr.slice(i, i \u002B 9);\r\n \r\n var avg = range.reduce(function(accu, next){ return accu \u002B next ;}) / 9;\r\n}","IsDeferred":false},{"Name":"reduce","Code":"var sum = 0;\r\nfor (var i = 0; i \u003C arr.length; i\u002B\u002B) {\r\n sum \u002B= arr[i];\r\n\r\n if (i \u003E 8) {\r\n sum -= arr[i - 9];\r\n }\r\n \r\n if (i \u003E 8)\r\n {var avg = sum / 9;}\r\n}","IsDeferred":false}]}