|
| 1 | +<h2><a href="https://leetcode.com/problems/number-of-employees-who-met-the-target">2876. Number of Employees Who Met the Target</a></h2><h3>Easy</h3><hr><p>There are <code>n</code> employees in a company, numbered from <code>0</code> to <code>n - 1</code>. Each employee <code>i</code> has worked for <code>hours[i]</code> hours in the company.</p> |
| 2 | + |
| 3 | +<p>The company requires each employee to work for <strong>at least</strong> <code>target</code> hours.</p> |
| 4 | + |
| 5 | +<p>You are given a <strong>0-indexed</strong> array of non-negative integers <code>hours</code> of length <code>n</code> and a non-negative integer <code>target</code>.</p> |
| 6 | + |
| 7 | +<p>Return <em>the integer denoting the number of employees who worked at least</em> <code>target</code> <em>hours</em>.</p> |
| 8 | + |
| 9 | +<p> </p> |
| 10 | +<p><strong class="example">Example 1:</strong></p> |
| 11 | + |
| 12 | +<pre> |
| 13 | +<strong>Input:</strong> hours = [0,1,2,3,4], target = 2 |
| 14 | +<strong>Output:</strong> 3 |
| 15 | +<strong>Explanation:</strong> The company wants each employee to work for at least 2 hours. |
| 16 | +- Employee 0 worked for 0 hours and didn't meet the target. |
| 17 | +- Employee 1 worked for 1 hours and didn't meet the target. |
| 18 | +- Employee 2 worked for 2 hours and met the target. |
| 19 | +- Employee 3 worked for 3 hours and met the target. |
| 20 | +- Employee 4 worked for 4 hours and met the target. |
| 21 | +There are 3 employees who met the target. |
| 22 | +</pre> |
| 23 | + |
| 24 | +<p><strong class="example">Example 2:</strong></p> |
| 25 | + |
| 26 | +<pre> |
| 27 | +<strong>Input:</strong> hours = [5,1,4,2,2], target = 6 |
| 28 | +<strong>Output:</strong> 0 |
| 29 | +<strong>Explanation:</strong> The company wants each employee to work for at least 6 hours. |
| 30 | +There are 0 employees who met the target. |
| 31 | +</pre> |
| 32 | + |
| 33 | +<p> </p> |
| 34 | +<p><strong>Constraints:</strong></p> |
| 35 | + |
| 36 | +<ul> |
| 37 | + <li><code>1 <= n == hours.length <= 50</code></li> |
| 38 | + <li><code>0 <= hours[i], target <= 10<sup>5</sup></code></li> |
| 39 | +</ul> |
0 commit comments