Count Positive Numbers

EasyArray

Description

Given an array of integers nums, return how many values are strictly greater than zero.

Examples

Input:nums = [-1,2,-3,4]
Output:2
Explanation:

There are 2 numbers in the list greater than zero.

Input:nums = [0,0,0]
Output:0
Explanation:

There are 0 numbers in the list greater than zero.

Input:nums = [5,6,7]
Output:3
Explanation:

There are 3 numbers in the list greater than zero.

Constraints

  • 1 ≤ nums.length ≤ 10⁴
  • -10⁹ ≤ nums[i] ≤ 10⁹

Ready to solve this problem?

Practice solo and sharpen your skills for technical interviews.