if (map.containsKey(sum)) { //this means the sum come back to equal to before value. Because there is only -1 and 1, so this means at this step, number of 1 equals to ...
number of 0 and 1. Note: The length of the given binary array will not exceed 50,000.
Some results have been hidden because they may be inaccessible to you
Show inaccessible results