Class Solution
-
- All Implemented Interfaces:
public final class Solution3266 - Final Array State After K Multiplication Operations II\.
Hard
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.
After the
koperations, apply modulo <code>10<sup>9</sup> + 7</code> to every value innums.Return an integer array denoting the final state of
numsafter performing allkoperations and then applying the modulo.Example 1:
Input: nums = 2,1,3,5,6, k = 5, multiplier = 2
Output: 8,4,6,5,6
Explanation:
Example 2:
Input: nums = 100000,2000, k = 2, multiplier = 1000000
Output: 999999307,999999993
Explanation:
Constraints:
<code>1 <= nums.length <= 10<sup>4</sup></code>
<code>1 <= numsi<= 10<sup>9</sup></code>
<code>1 <= k <= 10<sup>9</sup></code>
<code>1 <= multiplier <= 10<sup>6</sup></code>