Given an array of integers nums, count and return the number of occurrences of a given value.
Example:
Input: nums = [1, 4, 2, 2, 5, 2], value = 2
Output: 3
Explanation: the value 2 appears 3 times in the array
Note:
Do not use builtin functions, it would defy the purpose of the challenge. Write the whole code yourself.
Free plan: 30 tutor messages. Premium is unlimited.
Saved
Ctrl + Enter to check