#3784

Minimum Deletion Cost to Make All Characters Equal

specialist · 805 · lc medium +31 · 55% accepted · 87 likes · top 48%

Description

Given a string s of length n and an integer array cost where cost[i] is the expense to remove the i-th character, delete the minimum-cost set of characters so that every remaining character in the non-empty result is identical, and return that minimum total cost.

Code

1
2
3