Company: Deshaw
Difficulty: medium
Minimize Cost Difference Problem Description There are n items in the shop, where the cost of the ith item is represented by cost[i]. The shopkeeper wants to normalize the cost of the item, i.e., decrease the cost difference between the items with maximum and minimum costs. But, the shopkeeper cannot change the cost of the items suddenly as it will affect the reputation of the shop. The shopkeeper can choose to do the following operations for each of the m days: - Decrease the cost of the item with maximum cost by 1. - Increase the cost of the item with minimum cost by 1. - If there are multiple items with minimum or maximum cost in the array, only one item's cost can be increased/decreased. Given n items and an integer m, find the minimum possible difference between the maximum and minimum cost of the items in the array after m days. Complete the function getMinDiff in the editor below. getMinDiff takes the following arguments: - int cost[n]: the cost of items - int m: the number of d