Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
This comment is hidden because it contains spoiler information about the solution
return the longest substring(which is palindrome)'s length... It's really confuse
in 'palindrome' are 55 substrings? it's correct ??
A palindrome is a sequence of letters which reads the same backward as forward, e.g.
"rotator"
(see Wikipedia).There are
n * (n + 1) / 2
substrings in every string, e.g."palindrome"
has substrings"palindrome"
,"palindrom"
,"alindrome"
,"palindro"
,"alindrom"
,"lindrome"
, ...Find the length of the longest substring that is a palindrome.
E.g.
"asequenceofletters"
contains the substring"ette"
which is a palindrom. Result: 4.