Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
longest_palindromic solution in Clear category for The Longest Palindromic by kurosawa4434
def longest_palindromic(text):
text_len = len(text)
for tgt_len in range(text_len, 0, -1):
for i in range(0, text_len - tgt_len + 1):
tgt_text = text[i: i + tgt_len]
if tgt_text == tgt_text[::-1]:
return tgt_text
July 15, 2016
Comments: