Intuit Interview Question

other was also a leetcode question. Based on connected components in a graph.