X333: countElements

Given an array of integers and an integer target, return a count of the number of times the target value occurs in the array.

Examples:

countElements({25, 42, 18, 25, 38, 96, 25, 25}, 25) -> 4
countElements({10, 20, 30, 40, 50}, 99) -> 0

Your Answer:

Reset

Practice a different Java exercise

Feedback

Your feedback will appear here when you check your answer.