If same unique element is not present in S and P , then take characters that make string T lexicographically smallest
for ( char i = ' a ' ; i <= ' z ' ; i ++ ) { if ( mapS . getOrDefault ( i , 0 ) > 0 || mapP . getOrDefault ( i , 0 ) > 0 ) { half1 . append ( i ) ; return half1 . append ( tmp ) . toString ( ) ; } }