ZQFONDI4BKCOY3OT4FRASFDRLRVMXHGPBTAJ62CGRVFSNGPEKWJQC
func palindrome(str string) string {
// Single thread version
func palindrome_single(str string) string {
longest := ""
for k := 0; k < len(str)/2+1; k++ {
candidate := string(str[k])
for i := 1; true; i++ {
// avoid overrun or underrun
if (k-i < 0) || (k+i > len(str)-1) {
break
}
// two identical bytes
if str[k-i] == str[k+i] {
candidate = string(str[k-i]) + candidate + string(str[k+i])
} else {
break
}
}
if len(candidate) > len(longest) {
longest = candidate
}
}
return longest
}
// Returns the longest palindrome in str
// Concurrent version
func Palindrome(str string) string {