Count Target

L1 Easy Arrays & Hashing
Concept
Counting how often a specific value appears is a loop plus an equality check. Equal-to comparisons are the core of most counting work.
Count how many times target appears inside nums, then return that count.
Examples
▸ nums = [1, 2, 3, 2, 2], target = 2
→ 3
▸ nums = [], target = 5
→ 0
▸ nums = [4, 4, 4], target = 4
→ 3
Progressive Hints
Hint 1 · Nudge
You're only looking for one exact value among the many.
Hint 2 · Plan
Start a counter at 0. Loop over the array and bump the counter whenever an element equals target. Return the counter.
Hint 3 · Approach
count = 0. For each n: if n == target then count = count + 1. Return count.
Output
// Run your code to see the output here.