12 lines js solution faster than 100% js solutions
First I found out how many ones are in the array. Then I checked if the array is dividable into 3 with the same amount of ones. Then I iterated from the end to 
First I found out how many ones are in the array. Then I checked if the array is dividable into 3 with the same amount of ones. Then I iterated from the end to find out the number. Once I had the number all I had to do is to validate if the sequence of first and second sets match.\n```\n/**\n * @param {number[]} arr\n * @return {number[]}\n */\nvar threeEqualParts = function(arr) {\n  const ones = arr.reduce((s, n) => s + n, 0);\n  if (ones === 0) return [0, 2];\n  if (ones % 3 !== 0) return [-1, -1];\n  let onesToFind = ones / 3;\n  let k = arr.length;\n  while (onesToFind > 0) if (arr[--k] === 1) --onesToFind;\n  const iter = arr.length - k;\n  const firstOne = arr.indexOf(1);\n  const secondOne = arr.indexOf(1, firstOne + iter);\n  for (let i = 0; i < iter; i++)\n    if (arr[i + firstOne] !== arr[k + i] || arr[i + secondOne] !== arr[k + i]) return [-1, -1];\n  return [firstOne + iter - 1, secondOne + iter];\n};\n```
['JavaScript']