#3739
Count Subarrays With Majority Element II
candidate master · 1585 · lc hard +32 · 44.5% accepted · 62 likes · top 27%
Description
Given an integer array nums and an integer target, count the subarrays where target occurs strictly more than half the time, and return that count.
Code
1
2
3