Union Find
· โ 3 min read · ๐ฆ Kyle
Description from wiki: a disjoint-set data structure, also called a unionโfind data structure or mergeโfind set, is a data structure that stores a collection of disjoint (non-overlapping) sets
you can easily solve leetcode: 547. Number of Provinces w/ UF.
get UF template at github/sky-bro/AC/Algorithms/Union Find