Count Target in Grid
grid is a 2-D array of whole numbers. Return how many cells are equal to target, as an int.
Example 1
grid [[1,2,3],[2,2,9]]
target 2
returns 3
The value 2 appears three times.
Constraints
1 <= rows, columns <= 10
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More NumPy problems
- Count the MaximumBeginner
- Cumulative MaxBeginner
- Day to Day ChangeBeginner
- Diagonal From ValuesBeginner
- Evenly SpacedBeginner
- Every Other SumBeginner
- Hottest DayBeginner
- Lower Triangle TotalBeginner