Data Structures & AlgorithmsVery hardICPC regional · Amazon SDE OA

What is the minimum number of single-character replacements needed to make "abcdba" a palindrome?

  1. A. 2
  2. B. 0
  3. C. 1
  4. D. 4

Correct answer: C. 1

Each mirrored pair of positions with different letters needs exactly one replacement, and pairs with equal letters need none. Counting all unequal positions double-counts each pair.

More Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questions

Exams that ask this topic