Just count the number of employees who are >= target

Code:

Python3

def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:
    return sum(1 for h in hours if h >= target)

Big O Analysis

  • Runtime

    The runtime complexity here is .

  • Memory The memory usage is since we are building an array first and then summing it up.

— A

GitHub | Twitter