Checking if the reverse of the string is already present in the set
else if ( dict . find ( t ) != dict . end ( ) ) { left . push_back ( S [ i ] ) ; right . push_back ( t ) ; dict . erase ( S [ i ] ) ; dict . erase ( t ) ; } } printPalindrome ( left , mid , right ) ; }