
787. Cheapest Flights Within K Stops
·
Algorithm
Cheapest Flights Within K Stops - 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 1. Dijkstra와 경유지 횟수를 고려한 최단 거리 알고리즘 (실패) 원인 결국 최단거리 배열에 저장되는 거리는 경유지 횟수를 고려하지 않은 최단거리가 될 수밖에 없음 from typing import * from heapq import * from collections import defaultdict # k번 이하의 경유지를 이용할 수 있을 경우의 ..