Minimum Cost to Clear the Dataset
Asked at Amazon · Coding Questions · Difficulty: Medium
Repeatedly remove two characters from `dataset` until it is empty. Removing two identical characters costs `x`; two different characters costs `y`. Return the minimum total cost.
Loading the problem…