You are given an array arr containing values equal to
Formally, find indices i and j with
arr[0] through arr[i] forms the first part,
arr[i + 1] through arr[j - 1] forms the second part, and
arr[j] through arr[arr.length - 1] forms the third part.
All three parts, when evaluated as binary numbers, must represent the same value. Leading zeros are ignored when evaluating the binary value.
Return [i, j] if such a partition is possible, or [-1, -1] otherwise.
Note: A segment containing only
elements represents the numerical value .
Constraints:
arr.length
arr[i] is
You are given an array arr containing values equal to
Formally, find indices i and j with
arr[0] through arr[i] forms the first part,
arr[i + 1] through arr[j - 1] forms the second part, and
arr[j] through arr[arr.length - 1] forms the third part.
All three parts, when evaluated as binary numbers, must represent the same value. Leading zeros are ignored when evaluating the binary value.
Return [i, j] if such a partition is possible, or [-1, -1] otherwise.
Note: A segment containing only
elements represents the numerical value .
Constraints:
arr.length
arr[i] is