Skip to content

Practice Final Array State After K Multiplication Operations II

Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.

Hard#3266
LeetCode Problem

Final Array State After K Multiplication Operations II

Problem Statement

Perform exactly k operations on nums. Each operation chooses the smallest current value, breaking ties by the earliest index, and multiplies that entry by multiplier. After all operations, reduce every entry modulo 10^9 + 7. Return the final array in its original index order; the modulo is applied after the selection operations.

Source: Final Array State After K Multiplication Operations II on LeetCode. Use the original task for its coding environment and submissions.

Examples

# Example 1

Input
nums = [2,1,3,5,6], k = 5, multiplier = 2
Output
[8,4,6,5,6]

# Example 2

Input
nums = [100000,2000], k = 2, multiplier = 1000000
Output
[999999307,999999993]

Constraints

1 <= nums.length <= 10^4
1 <= nums[i] <= 10^9
1 <= k <= 10^9
1 <= multiplier <= 10^6

Related LeetCode Problems

Practice more problems similar to Final Array State After K Multiplication Operations II.

Review your practice with PhantomCodeAI

After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.