[Programmers] Level 2. 도넛과 막대 그래프
·
코딩테스트/Python
🔗 Problem Link 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr❔Thinking사이클을 이루는 도넛모양 그래프, 한줄로 이어진 막대 그래프, 동일한 도넛 모양 2개가 이어진 8자 모양 그래프의 각 개수를 반환한다.그래프를 이루는 정점 이외에 하나의 생성점이 각 그래프와 연결되어 있고, 이 생성점도 찾아 반환한다.💻Solutionfrom collections import defaultdict, dequedef solution(edges): answer = [0, 0, 0, 0] start, donut, bar, eight = 0, 1, 2, 3 graph = defaultdi..