This is the problem minimum-cost-to-connect-two-groups-of-points, please go through it. I'm stuck at this point: - At each level (going through each point 1..n in group 1) if I'm iterating different subgroups of group2 to connect, how to efficiently calculate the cost for the new connections excluding the connections already connected in previous level? - Or is there another way to do it?