Lexicographically minimum String possible – GeeksforGeeks
Given three strings, S1, S2, and S3. The characters at the same index in S1 and S2 are considered equivalent and follow the transitive property. For example, if S1 = ‘abc’ and S2 = ‘xcd’, then characters {a, x} are equivalent, and characters {b, c, d} are equivalent, the task is to find and print the lexicographically smallest string that you can obtain from S3 by changing its characters to some other equivalent character obtained from S1 and S2. In other words, you need to replace the characters in S3 with their…