Skip to content

Commit ff63d3d

Browse files
authoredJan 19, 2023
Create 2529. Maximum Count of Positive Integer and Negative Integer
1 parent 0320d74 commit ff63d3d

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
class Solution {
2+
public:
3+
int maximumCount(vector<int>& nums) {
4+
int cnt=0;
5+
int cnt1=0;
6+
for(int i=0;i<nums.size();i++)
7+
{
8+
if(nums[i]>0) cnt++;
9+
else if(nums[i]<0) cnt1++;
10+
}
11+
if(cnt>cnt1) return cnt;
12+
else return cnt1;
13+
}
14+
};

0 commit comments

Comments
 (0)
Please sign in to comment.