Palindromic Substring

STRING

Problem

Given a string s, return the length of the longest palindromic substring in s.

Examples

longestPalindrome("cocod"); // returns 3 // The longest palindrome is "coc" or "oco" which are of size 3 longestPalindrome("coop"); // returns 2 // The longest palindrome is "oo" which is of size 2
Loading...