It is same with .... https://leetcode.com/problems/connecting-cities-with-minimum-cost/
Good luck dude~