编写一个程序来找到给定字符串中的最长回文子串并返回该子串。
s = "babad"
# TODO: Write a function to find the longest palindrome substring in string "s"
以下是Python 3的实现：

def longest_palindrome(s):
    longest = ""
    for i in range(len(s)):
        for j in range(i, len(s)):
            sub = s[i:j+1]
            if sub == sub[::-1] and len(sub) > len(longest):
                longest = sub
    return longest

输入字符串“babad”将输出“bab”或“aba”。