Count Subarrays With Majority Element II
Map each value to +1 when it equals the target and -1 otherwise, then count subarrays whose balance is positive.
Map each value to +1 when it equals the target and -1 otherwise, then count subarrays whose balance is positive.