<commit_before># A palindrome is a sequence of letters which reads the same backward as
# forward, like “madam” for example.
# For a given input string S, you have to return the longest palindrome found
# within. If multiple substrings qualify, print them all in the same order as
# they appear in S.


text = input()
result = []

data = "|%s|" % ("|".join(text))
right, center = 0, 0
m, n = 0, 0
d_len = len(data)
length = [0] * d_len

for i in range(d_len):
    len_i = max(1, min(length[2 * center - i], right - i))
    while i >= len_i < d_len - i and data[i - len_i] == data[i + len_i]:
        len_i += 1
    if right < len_i + i:
        right = len_i + i
        center = i
        if right - center >= n - m:
            m, n = center, right
            result.append(''.join([x for i, x in enumerate(data[2 * m - n + 1:n]) if i % 2]))
    length[i] = len_i

best = max(length) - 1
for r in result:
    if len(r) == best:
        print(r)
<commit_msg>Update community_longest-palindrome.py<commit_after># A palindrome is a sequence of letters which reads the same backward as
# forward, like “madam” for example.
# For a given input string S, you have to return the longest palindrome found
# within. If multiple substrings qualify, print them all in the same order as
# they appear in S.


text = input()
result = []

data = '|{}|'.format('|'.join(text))
right, center = 0, 0
m, n = 0, 0
d_len = len(data)
length = [0] * d_len

for i in range(d_len):
    len_i = max(1, min(length[2 * center - i], right - i))
    while i >= len_i < d_len - i and data[i - len_i] == data[i + len_i]:
        len_i += 1
    if right < len_i + i:
        right = len_i + i
        center = i
        if right - center >= n - m:
            m, n = center, right
            result.append(''.join([x for i, x in enumerate(data[2 * m - n + 1:n]) if i % 2]))
    length[i] = len_i

best = max(length) - 1
for r in result:
    if len(r) == best:
        print(r)

{'fraction_non_alphanumeric': 0.13391482811698308, 'fraction_numerical': 0.012314007183170857, 'mean_word_length': 2.463587921847247, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5811462', 'n_tokens_mistral': 708, 'n_tokens_neox': 687, 'n_words': 270}