You are given a string s and an integer array cost of the same length n, where cost[i] represents the cost of removing the character at index i from s.
You want to remove characters from s such that all remaining characters in the string are identical.
Return the minimum total cost needed to make all remaining characters in s equal.
Constraints:
n s.length cost.length
n
cost[i]
s consists of lowercase English letters.
You are given a string s and an integer array cost of the same length n, where cost[i] represents the cost of removing the character at index i from s.
You want to remove characters from s such that all remaining characters in the string are identical.
Return the minimum total cost needed to make all remaining characters in s equal.
Constraints:
n s.length cost.length
n
cost[i]
s consists of lowercase English letters.