DIY: Palindromic Substrings
Solve the interview question "Palindromic Substrings" in this lesson.
We'll cover the following
Given a string
s, your task is to implement the algorithm that will return the number of palindromic substrings in it.
Note: A string is a palindrome when it reads the same backward as forward, and a substring is a contiguous sequence of characters within the string.
Consider the string
"abb". The substrings of
"bb". Of these, all four are palindromes, so the algorithm should return