Company: Amazon_23july
Difficulty: medium
Minimize Cleaning Cost Problem Data Scientists at Amazon are working on cleansing a machine learning dataset. The dataset is represented as a string dataset consisting of an even number of lowercase English letters. The goal is to clean the dataset efficiently by performing specific operations. Here is how the operations work: In each operation, two characters from the dataset are selected and removed. The two characters may be at any positions in the current string; they do not have to be adjacent. Each operation has an associated cost: matchCost : the cost of removing two identical characters. mismatchCost : the cost of removing two different characters. The task is to determine the optimal strategy that minimizes the total cost to completely clean up the dataset. In other words, find the minimum cost required to remove all characters and make the dataset empty. Complete the function minimizeCleaningCost(dataset, matchCost, mismatchCost) , which returns an integer: the minimum total