Repeatedly pick the smallest array element, multiply it by a given factor, and return the final array state after operations.
You are given an integer array nums, an integer k, and an integer multiplier.
Perform exactly k operations. In each operation:
multiplier.After all operations, return the resulting array.
The array is updated in place after every operation, so later choices use the latest values.
Simulate the process efficiently and return the final array state.
nums: integer arrayk: number of operations to performmultiplier: integer factor applied to the chosen element each stepnums after exactly k operations.k updates.Example 1
Input
nums = [2, 1, 3], k = 2, multiplier = 3
Output
[6, 3, 3]
Explanation
Step 1: the minimum is 1 at index 1, so it becomes 3. Array becomes [2, 3, 3]. Step 2: the minimum is 2 at index 0, so it becomes 6. Final array is [6, 3, 3].
Example 2
Input
nums = [5], k = 4, multiplier = 2
Output
[80]
Explanation
There is only one element, so it is chosen every time: 5 -> 10 -> 20 -> 40 -> 80.
Premium problem context
Premium adds guided hints, editorial links, similar variants, discussion resources, and concept maps so you can understand why a problem matters, not just solve it once.