Class Solution

  • All Implemented Interfaces:

    
    public final class Solution
    
                        

    3266 - Final Array State After K Multiplication Operations II\.

    Hard

    You are given an integer array nums, an integer k, and an integer multiplier.

    You need to perform k operations on nums. In each operation:

    • Find the minimum value x in nums. If there are multiple occurrences of the minimum value, select the one that appears first.

    • Replace the selected minimum value x with x * multiplier.

    After the k operations, apply modulo <code>10<sup>9</sup> + 7</code> to every value in nums.

    Return an integer array denoting the final state of nums after performing all k operations 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>

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
      Solution()
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final IntArray getFinalState(IntArray nums, Integer k, Integer multiplier)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait