Finding X , such that s [ currIndex ] + X + s [ currIndex ] is palindrome .
temp = currNode NEW_LINE while True : NEW_LINE INDENT currLength = tree [ temp ] . length NEW_LINE if ( currIndex - currLength >= 1 and ( s [ currIndex ] == s [ currIndex - currLength - 1 ] ) ) : NEW_LINE INDENT break NEW_LINE DEDENT temp = tree [ temp ] . suffixEdge NEW_LINE DEDENT