Given a string, count the number of palindromic contiguous substrings in the string.
The substrings with different start indexes or end indexes are counted as different substrings even they consist of same characters.
Example:
Input: "abbcbc" Output: 9 Explanation: ["a", "b", "b", "c", "b", "c", "bb", "bcb", "cbc"]
Walkthroughs of the solution. Try the steps first, then watch to compare approaches.
Free plan: 30 tutor messages. Premium is unlimited.
Saved
Ctrl + Enter to check