mirror of
				https://gitee.com/coder-xiaomo/leetcode-problemset
				synced 2025-11-04 19:53:12 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			92 lines
		
	
	
		
			2.2 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			92 lines
		
	
	
		
			2.2 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
<p>You are given an integer array <code>nums</code>, an integer <code>k</code>, and an integer <code>multiplier</code>.</p>
 | 
						|
 | 
						|
<p>You need to perform <code>k</code> operations on <code>nums</code>. In each operation:</p>
 | 
						|
 | 
						|
<ul>
 | 
						|
	<li>Find the <strong>minimum</strong> value <code>x</code> in <code>nums</code>. If there are multiple occurrences of the minimum value, select the one that appears <strong>first</strong>.</li>
 | 
						|
	<li>Replace the selected minimum value <code>x</code> with <code>x * multiplier</code>.</li>
 | 
						|
</ul>
 | 
						|
 | 
						|
<p>Return an integer array denoting the <em>final state</em> of <code>nums</code> after performing all <code>k</code> operations.</p>
 | 
						|
 | 
						|
<p> </p>
 | 
						|
<p><strong class="example">Example 1:</strong></p>
 | 
						|
 | 
						|
<div class="example-block">
 | 
						|
<p><strong>Input:</strong> <span class="example-io">nums = [2,1,3,5,6], k = 5, multiplier = 2</span></p>
 | 
						|
 | 
						|
<p><strong>Output:</strong> <span class="example-io">[8,4,6,5,6]</span></p>
 | 
						|
 | 
						|
<p><strong>Explanation:</strong></p>
 | 
						|
 | 
						|
<table>
 | 
						|
	<tbody>
 | 
						|
		<tr>
 | 
						|
			<th>Operation</th>
 | 
						|
			<th>Result</th>
 | 
						|
		</tr>
 | 
						|
		<tr>
 | 
						|
			<td>After operation 1</td>
 | 
						|
			<td>[2, 2, 3, 5, 6]</td>
 | 
						|
		</tr>
 | 
						|
		<tr>
 | 
						|
			<td>After operation 2</td>
 | 
						|
			<td>[4, 2, 3, 5, 6]</td>
 | 
						|
		</tr>
 | 
						|
		<tr>
 | 
						|
			<td>After operation 3</td>
 | 
						|
			<td>[4, 4, 3, 5, 6]</td>
 | 
						|
		</tr>
 | 
						|
		<tr>
 | 
						|
			<td>After operation 4</td>
 | 
						|
			<td>[4, 4, 6, 5, 6]</td>
 | 
						|
		</tr>
 | 
						|
		<tr>
 | 
						|
			<td>After operation 5</td>
 | 
						|
			<td>[8, 4, 6, 5, 6]</td>
 | 
						|
		</tr>
 | 
						|
	</tbody>
 | 
						|
</table>
 | 
						|
</div>
 | 
						|
 | 
						|
<p><strong class="example">Example 2:</strong></p>
 | 
						|
 | 
						|
<div class="example-block">
 | 
						|
<p><strong>Input:</strong> <span class="example-io">nums = [1,2], k = 3, multiplier = 4</span></p>
 | 
						|
 | 
						|
<p><strong>Output:</strong> <span class="example-io">[16,8]</span></p>
 | 
						|
 | 
						|
<p><strong>Explanation:</strong></p>
 | 
						|
 | 
						|
<table>
 | 
						|
	<tbody>
 | 
						|
		<tr>
 | 
						|
			<th>Operation</th>
 | 
						|
			<th>Result</th>
 | 
						|
		</tr>
 | 
						|
		<tr>
 | 
						|
			<td>After operation 1</td>
 | 
						|
			<td>[4, 2]</td>
 | 
						|
		</tr>
 | 
						|
		<tr>
 | 
						|
			<td>After operation 2</td>
 | 
						|
			<td>[4, 8]</td>
 | 
						|
		</tr>
 | 
						|
		<tr>
 | 
						|
			<td>After operation 3</td>
 | 
						|
			<td>[16, 8]</td>
 | 
						|
		</tr>
 | 
						|
	</tbody>
 | 
						|
</table>
 | 
						|
</div>
 | 
						|
 | 
						|
<p> </p>
 | 
						|
<p><strong>Constraints:</strong></p>
 | 
						|
 | 
						|
<ul>
 | 
						|
	<li><code>1 <= nums.length <= 100</code></li>
 | 
						|
	<li><code>1 <= nums[i] <= 100</code></li>
 | 
						|
	<li><code>1 <= k <= 10</code></li>
 | 
						|
	<li><code>1 <= multiplier <= 5</code></li>
 | 
						|
</ul>
 |