Class Solution
-
- All Implemented Interfaces:
public final class Solution3264 - Final Array State After K Multiplication Operations I.
Easy
You are given an integer array
nums, an integerk, and an integermultiplier.You need to perform
koperations onnums. In each operation:Find the minimum value
xinnums. If there are multiple occurrences of the minimum value, select the one that appears first.Replace the selected minimum value
xwithx * multiplier.
Return an integer array denoting the final state of
numsafter performing allkoperations.Example 1:
Input: nums = 2,1,3,5,6, k = 5, multiplier = 2
Output: 8,4,6,5,6
Explanation:
Example 2:
Input: nums = 1,2, k = 3, multiplier = 4
Output: 16,8
Explanation:
Constraints:
1 <= nums.length <= 1001 <= nums[i] <= 1001 <= k <= 101 <= multiplier <= 5