We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a1a7ec4 commit 03048a4Copy full SHA for 03048a4
my-submissions/e2529 v1.py
@@ -0,0 +1,9 @@
1
+class Solution:
2
+ def maximumCount(self, nums: List[int]) -> int:
3
+ pos = neg = 0
4
+ for n in nums :
5
+ if n > 0 :
6
+ pos += 1
7
+ elif n < 0 :
8
+ neg += 1
9
+ return max(pos, neg)
my-submissions/e2529 v2 oneliner.py
@@ -0,0 +1,3 @@
+ return max((pos := sum(x > 0 for x in nums)), len(nums) - nums.count(0) - pos)
0 commit comments