{"ScriptPreparationCode":"function randomIntFromInterval(min, max) {\r\n // min and max included\r\n return Math.floor(Math.random() * (max - min \u002B 1) \u002B min);\r\n}\r\nvar rows = [];\r\nlet lasth = 0;\r\nfor (let i = 0; i \u003C 10000; i\u002B\u002B) {\r\n lasth \u002B= randomIntFromInterval(16, 50);\r\n rows.push(lasth);\r\n}\r\n\r\nfunction sliceRange(arr, min, max) {\r\n var l = 0,\r\n r = arr.length;\r\n while (l \u003C r) {\r\n var m = ~~(l \u002B (r - l) / 2);\r\n if (arr[m] \u003C min) l = m \u002B 1;\r\n else if (arr[m] \u003E max) r = m;\r\n else break;\r\n }\r\n \r\n var lr = m,\r\n rl = m;\r\n while (l \u003C lr) {\r\n m = ~~(l \u002B (lr - l) / 2);\r\n if (arr[m] \u003C min) l = m \u002B 1;\r\n else lr = m;\r\n }\r\n while (rl \u003C r) {\r\n m = ~~(rl \u002B (r - rl) / 2);\r\n if (arr[m] \u003E max) r = m;\r\n else rl = m \u002B 1;\r\n }\r\n return [l-1, r\u002B1];\r\n}\r\n","TestCases":[{"Name":"sliceRange","Code":"sliceRange(rows, 70000, 70400)","IsDeferred":false},{"Name":"findIndex","Code":"rows.findIndex( x =\u003E x \u003E 70000)-1","IsDeferred":false}]}