{"ScriptPreparationCode":"function test1(array) {\r\n\tfor (let i = 0; i \u003C array.length; i\u002B\u002B) {\r\n\t\tlet lsum = array.slice(0, i).reduce((carry, value) =\u003E carry \u002B value, 0);\r\n\t\tlet rsum = array.slice(i).reduce((carry, value) =\u003E carry \u002B value, 0);\r\n\t\tif (lsum === rsum) return i;\r\n\t}\r\n\treturn -1;\r\n}\r\n\r\nfunction test2(array) {\r\n\tlet sum = array.reduce((carry, value) =\u003E carry \u002B value, 0);\r\n\tfor (let i = 0, lsum = 0, rsum = sum; i \u003C array.length; i\u002B\u002B, lsum \u002B= array[i - 1], rsum -= array[i - 1]) {\r\n\t\tif (lsum === rsum) {\r\n\t\t\treturn i;\r\n\t\t}\r\n\t}\r\n\treturn -1;\r\n}\r\n","TestCases":[{"Name":"function 1","Code":"test1([1, 5, -8, 0, -2]);\r\ntest1([-2, 2, 5]);\r\ntest1([1, 1, 1, 1, -4]);","IsDeferred":false},{"Name":"function 2","Code":"test2([1, 5, -8, 0, -2]);\r\ntest2([-2, 2, 5]);\r\ntest2([1, 1, 1, 1, -4]);","IsDeferred":false}]}