Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
simple and understandable ! solution in Clear category for The Longest Palindromic by serg3y1999
def longest_palindromic(line):
l = []
for el in range(len(line)):
tmp = ""
for i in range(el,len(line)):
tmp += line[i]
if tmp == tmp[::-1]:
l.append(tmp)
return max(l, key = lambda x: len(x))
Sept. 2, 2018