LeetCode
Smallest String With Swaps
Click
here
for an explanation.