Problem
Given a natural number n and an array numbers of natural number elements, write a function solution that returns the count of n in numbers.
Constraints
nand each element innumbersare natural numbers up to 10.numbersis not empty, and its length does not exceed 100.
Test Case
| Test Case Number | n | numbers | return |
|---|---|---|---|
| 1 | 1 | [1, 2, 3, 4] | 1 |
| 2 | 5 | [5, 5, 5, 5, 5, 5, 5] | 7 |
| 3 | 3 | [4, 5, 6, 7, 8, 9] | 0 |
Explanation for Test Case 1
- The count of
1innumbersis 1, so the return value is1.
Explanation for Test Case 2
- The count of
5innumbersis 7, so the return value is7.
Explanation for Test Case 3
- Since
3does not exist innumbers, the return value is0.