Reverse the remaining string to find the palindromic suffix
reverse ( rem_str . begin ( ) , rem_str . end ( ) ) ; string suff_of_rem_str = palindromePrefix ( rem_str ) ; if ( pre_of_rem_str . size ( ) >= suff_of_rem_str . size ( ) ) { return pre + pre_of_rem_str + suff ; } else { return pre + suff_of_rem_str + suff ; } }