Get Minimum Operation Count

Problem Overview

  • Determine the minimum edits to make a lowercase string “beautiful,” meaning no adjacent characters are equal or consecutive in the alphabet.
  • Input: string s (2 ≤ |s| ≤ 1e5). Output: integer minimum operation count.
  • Allowed operation: change any character at any index to any lowercase English letter.
  • Domain: string processing and text validation relevant to data cleanup/use cases.
  • Asked in IBM interviews; a coding interview problem and interview question.

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Input Variables
Execution Result: