Repeatedly multiply the smallest array element by a factor for k operations, then return the final array state.
You are given an integer array nums, an integer k, and an integer multiplier.
Repeat the following operation exactly k times:
nums.multiplier.After all operations, return the final state of the array.
This problem asks you to efficiently simulate the process without re-scanning the entire array from scratch on every step.
numskmultiplierk times.1 <= nums.lengthk >= 0multiplier >= 1Example 1
Input
nums = [2,1,3], k = 3, multiplier = 2
Output
[4,4,3]
Explanation
Operations:
1 at index 1 -> [2,2,3]2 at index 0 (tie with index 1, smaller index wins) -> [4,2,3]2 at index 1 -> [4,4,3]Example 2
Input
nums = [1,2,1], k = 2, multiplier = 3
Output
[3,2,3]
Explanation
Operations:
1 at index 0 -> [3,2,1]1 at index 2 -> [3,2,3]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.