If same unique element is not present in S and P , then take characters that make string T lexicographically smallest
for i in range ( ord ( ' a ' ) , ord ( ' z ' ) + 1 ) : NEW_LINE INDENT if ( mapS [ i ] > 0 or mapP [ i ] > 0 ) : NEW_LINE INDENT half1 += chr ( i ) NEW_LINE return half1 + half2 NEW_LINE DEDENT DEDENT