Leetcode 1202. Smallest String With Swaps – Disjoint Set /

Leetcode 1202. Smallest String With Swaps – Disjoint Set / Union-Find

#Leetcode #Smallest #String #Swaps #Disjoint #Set

“Code Yao”

See other videos @Code Yao
A Python union-find solution to Leetcode 1202 – Smallest String With Swaps.
We use union operation to form clusters and do sort per cluster. After the solution, we did a rough time complexity analysis for fun, focusing on the sorting of the clusters. In this solution,…

source

Exit mobile version