Loading...
Given a string s, return the longest palindromic substring in s.
babad
bab
s is babad, and we need to find the longest palindromic substring in it.bab and aba, both with a length of 3.bab and aba are the longest palindromic substrings, the function can return either one, and in this case, it returns bab.