Data Structures & AlgorithmsHardGATE CS · TCS NQT

How many palindromic substrings of length 3 or more does racecar contain (counted by position)?

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

Correct answer: B. 3

The palindromes of length 3 or more are cec, aceca and racecar, so the count is 3.

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

Exams that ask this topic