Transform String (Google India)

Problem Overview

  • Find the minimum number of operations to transform one string into another under adjacency rules.
  • Input: two equal-length strings over {x, y, z}, each with no consecutive identical characters; Output: minimal operation count.
  • Operation: change any single character, but the string must still have no adjacent equal characters after each change.
  • Domain: string transformation/text processing; a Google India coding interview problem and interview question from Google interviews.

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: