hackerrank graph theory problem which merges disjoint sets for path compression.
hackerrank graph theory problem which merges disjoint sets for path compression.
ref: https://www.hackerrank.com/challenges/journey-to-the-moon/problem