Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
3-liner: shortest non-recursive solution in Creative category for The Longest Palindromic by przemyslaw.daniel
def longest_palindromic(t,l=len,d=divmod):
return max([t[x:y] for x,y in(d(i,l(t)+1) for i in
range((l(t)+1)**2))if t[x:y]==t[x:y][::-1]],key=len)
Oct. 11, 2017
Comments: