You are given an integer array nums and two integers cost1 and cost2.
You can perform two types of operations on the array any number of times:
Choose an index i and increase nums[i] by cost1.
Choose two distinct indices i and j and increase both nums[i] and nums[j] by cost2.
Return the minimum cost to make all elements of nums equal. Since the answer may be very large, return it modulo
Constraints:
nums.length
nums[i]
cost1
cost2
You are given an integer array nums and two integers cost1 and cost2.
You can perform two types of operations on the array any number of times:
Choose an index i and increase nums[i] by cost1.
Choose two distinct indices i and j and increase both nums[i] and nums[j] by cost2.
Return the minimum cost to make all elements of nums equal. Since the answer may be very large, return it modulo
Constraints:
nums.length
nums[i]
cost1
cost2