My approach is- I have sort all the edges in decreasing order according to their weights. And when I am getting super_parent_of_x and super_parent_of_y as same, I am simply adding their weights till it is less than money.
This is the link to the solution-