Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
combinations solution in Clear category for The Longest Palindromic by gyahun_dash
from itertools import combinations as C
def longest_palindromic(text):
subs = (text[start: end] for start, end in C(range(len(text) + 1), 2))
return max((s for s in subs if s == s[::-1]), key=len)
March 2, 2016
Comments: