leetcode 797 스위프트1 [LeetCode] 797. All Paths From Source to Target (swift) All Paths From Source to Target - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 풀이 0번 부터 시작하여 n-1번까지 가는 경로를 모두 찾으면 되는 문제다. 입력 받은 graph에서 0번 꼭짓점과 연결된 꼭짓점부터 dfs를 탐색하도록 했다. // 0번 부터 탐색 시작 for vertex in graph[0] { dfs(vertex, [0, vertex], graph) } 비슷한 방식으로 dfs 함수 내에서 vertex와 연결된 꼭짓점으.. 2021. 10. 13. 이전 1 다음