LeetCode 2798 满足目标工作时长的员工数目
1. 题目
2024-04-30T00:18:11.png
今天的每日一题,没有什么难度,主要是记录自己现学的行内循环,可以简化统计列表数目的代码。
自己的代码:
class Solution:
def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:
return sum(i >= target for i in hours)
Comments | NOTHING