Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
LongestCommonSubstring solution in Clear category for The Longest Palindromic by VaclavTelensky
def longest_palindromic(text):
palindroms = []
for i in range(len(text)):
for j in range(i, len(text)):
if text[i:j+1] == text[i:j+1][::-1] and text[i:j+1] not in palindroms:
palindroms.append(text[i:j+1])
return max(palindroms, key=len)
March 16, 2016