whats wrong with my code
Religious peopls
@i_am_dekard_shaw
i have used the approach
if temp cost is less then each node has a temple build since road cost more
else
then u count no of independent component , for each independent component u calculate the no of nodes
supoose there are n node in one component among these n nodes 1 of them will have a temple and n-1 will incur road cost
hence the cost will be
for each indepedent component
totalCost += temple + (n-1) * cost of road
if temple cost > road cost
then : should i have to find all the edges in the component ?