Tap here to switch tabs
Problem
Submissions

Problem: Minimum Deletion Cost to Make All Characters Equal

Try to solve the Minimum Deletion Cost to Make All Characters Equal problem.

Statement

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

  • 1≤1 \leq n ≤105\leq 10^5

  • 1≤1 \leq cost[i] ≤109\leq 10^9

  • s consists of lowercase English letters.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Minimum Deletion Cost to Make All Characters Equal

Try to solve the Minimum Deletion Cost to Make All Characters Equal problem.

Statement

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

  • 1≤1 \leq n ≤105\leq 10^5

  • 1≤1 \leq cost[i] ≤109\leq 10^9

  • s consists of lowercase English letters.