Imagine you're a HR manager at a tech company reviewing employee performance! ๐
You have n employees numbered from 0 to n-1, and each employee i has worked for hours[i] hours this quarter. Your company has a minimum requirement that each employee must work at least target hours to meet their performance goal.
Given a 0-indexed array hours of length n containing non-negative integers representing hours worked by each employee, and a non-negative integer target representing the minimum required hours, your task is to determine how many employees have met or exceeded the target.
Goal: Return the count of employees who worked at least target hours.
Example: If hours = [0, 1, 2, 3, 4] and target = 2, then employees with indices 2, 3, and 4 have worked โฅ 2 hours, so the answer is 3.
Input & Output
Visualization
Time & Space Complexity
We must examine each of the n employees exactly once
Only using a constant amount of extra space for the counter
Constraints
- 1 โค n โค 50
- 0 โค hours[i], target โค 105
- hours.length equals the number of employees