Make Lexicographically Smallest Array by Swapping Elements

Solution Code
Video GuideLeetcode Daily

Time Complexity

O(N log N)

Space Complexity

O(N)