Reverse the remaining string to find the palindromic suffix
list1 = list ( rem_str ) NEW_LINE list1 . reverse ( ) NEW_LINE rem_str = ' ' . join ( list1 ) NEW_LINE suff_of_rem_str = palindromePrefix ( rem_str ) NEW_LINE if ( len ( pre_of_rem_str ) >= len ( suff_of_rem_str ) ) : NEW_LINE INDENT return ( pre + pre_of_rem_str + suff ) NEW_LINE DEDENT else : NEW_LINE INDENT return ( pre + suff_of_rem_str + suff ) NEW_LINE DEDENT