1578. Minimum Deletion Cost to Avoid Repeating Letters
https://leetcode.com/problems/minimum-deletion-cost-to-avoid-repeating-letters
Description
Given a string s
and an array of integers cost
where cost[i]
is the cost of deleting the ith
character in s
.
Return the minimum cost of deletions such that there are no two identical letters next to each other.
Notice that you will delete the chosen characters at the same time, in other words, after deleting a character, the costs of deleting other characters will not change.
Example 1:
Example 2:
Example 3:
Constraints:
s.length == cost.length
1 <= s.length, cost.length <= 10^5
1 <= cost[i] <= 10^4
s
contains only lowercase English letters.
ac
Previous1577. Number of Ways Where Square of Number Is Equal to Product of Two NumbersNext1579. Remove Max Number of Edges to Keep Graph Fully Traversable
Last updated