Updated UnionFind class with 2 memeber variable to track element count and cluster count.