Skip to content

Commit e749f6e

Browse files
committed
Runtime: 6 ms (Top 98.29%) | Memory: 18.00 MB (Top 55.02%)
1 parent 622fad6 commit e749f6e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Runtime: 6 ms (Top 98.29%) | Memory: 18.00 MB (Top 55.02%)
2+
3+
class Solution {
4+
public:
5+
int maximumCount(vector<int>& nums) {
6+
int neg = lower_bound(nums.begin(), nums.end(), 0) - nums.begin(), pos = nums.end() - upper_bound(nums.begin(), nums.end(), 0);
7+
return max(neg, pos);
8+
}
9+
};

0 commit comments

Comments
 (0)