Minimum Deletions to Eliminate Adjacent Equal Characters

Given a string s, one operation deletes any single character from the string.

Return the minimum number of deletions required so that the resulting string contains no pair of equal adjacent charact...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: