mirror of
				https://gitee.com/coder-xiaomo/leetcode-problemset
				synced 2025-11-04 11:43:12 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			40 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			40 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
<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>
 | 
						|
 | 
						|
<p>The company requires each employee to work for <strong>at least</strong> <code>target</code> hours.</p>
 | 
						|
 | 
						|
<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>
 | 
						|
 | 
						|
<p>Return <em>the integer denoting the number of employees who worked at least</em> <code>target</code> <em>hours</em>.</p>
 | 
						|
 | 
						|
<p> </p>
 | 
						|
<p><strong class="example">Example 1:</strong></p>
 | 
						|
 | 
						|
<pre>
 | 
						|
<strong>Input:</strong> hours = [0,1,2,3,4], target = 2
 | 
						|
<strong>Output:</strong> 3
 | 
						|
<strong>Explanation:</strong> The company wants each employee to work for at least 2 hours.
 | 
						|
- Employee 0 worked for 0 hours and didn't meet the target.
 | 
						|
- Employee 1 worked for 1 hours and didn't meet the target.
 | 
						|
- Employee 2 worked for 2 hours and met the target.
 | 
						|
- Employee 3 worked for 3 hours and met the target.
 | 
						|
- Employee 4 worked for 4 hours and met the target.
 | 
						|
There are 3 employees who met the target.
 | 
						|
</pre>
 | 
						|
 | 
						|
<p><strong class="example">Example 2:</strong></p>
 | 
						|
 | 
						|
<pre>
 | 
						|
<strong>Input:</strong> hours = [5,1,4,2,2], target = 6
 | 
						|
<strong>Output:</strong> 0
 | 
						|
<strong>Explanation:</strong> The company wants each employee to work for at least 6 hours.
 | 
						|
There are 0 employees who met the target.
 | 
						|
</pre>
 | 
						|
 | 
						|
<p> </p>
 | 
						|
<p><strong>Constraints:</strong></p>
 | 
						|
 | 
						|
<ul>
 | 
						|
	<li><code>1 <= n == hours.length <= 50</code></li>
 | 
						|
	<li><code>0 <= hours[i], target <= 10<sup>5</sup></code></li>
 | 
						|
</ul>
 |