python-algorithm
leetcode 2798. Number of Employees Who Met the Target
무적김두칠
2023. 8. 4. 13:08
https://leetcode.com/problems/number-of-employees-who-met-the-target/description/
Number of Employees Who Met the Target - LeetCode
Can you solve this real interview question? Number of Employees Who Met the Target - There are n employees in a company, numbered from 0 to n - 1. Each employee i has worked for hours[i] hours in the company. The company requires each employee to work for
leetcode.com
1
2
3
4
5
6
7
8
9
|
class Solution:
def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:
answer = 0
for hour in hours:
if hour >= target:
answer += 1
return answer
|
cs |
반응형