text. Count how many of its contiguous substrings are palindromes, meaning they read the same forwards and backwards.
Substrings with the same content but at different positions are counted separately. Every single letter is a palindrome too.text="level" → 7
Five single letters, plus "eve" and "level", for 7 in total.
text="zzz" → 6
Three "z" pieces, two "zz" pieces (different positions count separately) and "zzz", for 6.
text="map" → 3
text consists of lowercase English letterstext="level"
7
Run checks the first 3 tests in your browser. Submit checks all 142 tests on the server, hidden ones included.