Skip to content

Latest commit

 

History

History
19 lines (14 loc) · 414 Bytes

Day 120.md

File metadata and controls

19 lines (14 loc) · 414 Bytes

Day 120

Link: https://x.com/kom_senapati/status/1785128802777194571

Approach

  • Stored count of positive numbers in p
  • Then returned it and negetive number count (excluding zeroes) in a list

Code

class Solution:
    # @param A : list of integers
    # @return a list of integers
    def solve(self, A):
        p = len([n for n in A if n > 0])
        return [p, len(A) - p - A.count(0)]