Data Structures & AlgorithmsModerateTCS NQT · Infosys

Problem: How many palindromic substrings of even length does "abbaccdd" contain?

  1. A. 5
  2. B. 4
  3. C. 3
  4. D. 6

Correct answer: B. 4

Even-length substrings have an even number of characters, so the loop steps by two. Counting odd-length palindromes by mistake changes the total.

More Coding Interview Problems questions

Exams that ask this topic