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 |
반응형
'python-algorithm' 카테고리의 다른 글
백준 2393 Rook (0) | 2023.09.12 |
---|---|
백준 28235 코드마스터 2023 (0) | 2023.09.11 |
leetcode 2744. Find Maximum Number of String Pairs (0) | 2023.07.13 |
leetcode 2769. Find the Maximum Achievable Number (0) | 2023.07.13 |
leetcode 2739. Total Distance Traveled (0) | 2023.07.07 |
댓글