[프로그래머스] Level3 : 섬 연결하기 (파이썬)
·
Algorithm/Graph
MST 문제https://school.programmers.co.kr/learn/courses/30/lessons/42861 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr💡풀이코드 (성공 - MST Kruskal)def solution(n, costs): answer = [] graph = [] ans = 0 for n1, n2, w in costs: graph.append((w, n1, n2)) parent = [0] * (n + 1) def init(): for i in range(1, n + 1): parent[i..