Skip to content

Latest commit

 

History

History
45 lines (34 loc) · 999 Bytes

File metadata and controls

45 lines (34 loc) · 999 Bytes

2529. Question 2529

All prompts are owned by LeetCode. To view the prompt, click the title link above.

Back to top


First completed : March 12, 2025

Last updated : March 12, 2025


Related Topics : N/A

Acceptance Rate : Unknown


Solutions

Python

class Solution:
    def maximumCount(self, nums: List[int]) -> int:
        pos = neg = 0
        for n in nums :
            if n > 0 :
                pos += 1
            elif n < 0 :
                neg += 1
        return max(pos, neg)
class Solution:
    def maximumCount(self, nums: List[int]) -> int:
        return max((pos := sum(x > 0 for x in nums)), len(nums) - nums.count(0) - pos)