LeetCode
Lexicographically Smallest Equivalent String
Click
here
for an explanation.