Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Straightforward solution in Clear category for The Longest Palindromic by Pouf
def longest_palindromic(text):
s = len(text)
for size in range(s)[::-1]:
for index in range(s - size):
word = text[index:index + size + 1]
if word == word[::-1]:
return word
March 2, 2016
Comments: