Ad
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    return the longest substring(which is palindrome)'s length... It's really confuse

  • Custom User Avatar

    in 'palindrome' are 55 substrings? it's correct ??

  • Custom User Avatar

    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.