Count Nulls
EasyData EngineeringArray
Description
Given an array that may contain null entries, return how many of its entries are null.
Examples
Input:
[1,null,2,null,null]Output:
3Explanation:
Scanning the array and tallying the missing entries gives how many nulls it holds.
Input:
[1,2,3]Output:
0Explanation:
Scanning the array and tallying the missing entries gives how many nulls it holds.
Input:
[null,null]Output:
2Explanation:
Scanning the array and tallying the missing entries gives how many nulls it holds.
Constraints
- •
0 ≤ length ≤ 10⁴