You are given two nums and cost, both of length n.
In one operation, you can increase or decrease any element nums[i] by nums[i] is cost[i].
Return the minimum total cost to make all elements in nums equal.
Constraints:
n nums.length cost.length
n
nums[i], cost[i]
The test cases are generated such that the minimum cost does not exceed
You are given two nums and cost, both of length n.
In one operation, you can increase or decrease any element nums[i] by nums[i] is cost[i].
Return the minimum total cost to make all elements in nums equal.
Constraints:
n nums.length cost.length
n
nums[i], cost[i]
The test cases are generated such that the minimum cost does not exceed