Given an array of integers nums and a target integer, return the number of times target appears in nums.
Input
nums: an array of integers
target: the integer to count
Output
An integer count of how many elements in nums equal target.
Examples
Example 1
Inputnums = [1, 2, 3, 2, 4, 2], target = 2
Output3
Example 2
Inputnums = [5, 5, 5, 5], target = 5
Output4
Example 3
Inputnums = [1, 2, 3], target = 7
Output0
Constraints
0 <= nums.length
Return 0 when target does not appear.