This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import defaultdict | |
import heapq | |
def findCheapestPrice(self, n: int, flights: List[List[int]], src: int, dst: int, K: int) -> int: | |
flight_map = defaultdict(list) | |
for start, end, price in flights: | |
flight_map[start].append([end,price]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import defaultdict | |
def findCheapestPrice(self, n: int, flights: List[List[int]], src: int, dst: int, K: int) -> int: | |
flight_map = defaultdict(list) | |
for start, end, price in flights: | |
flight_map[start].append([end,price]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import defaultdict | |
import heapq | |
def findCheapestPrice(self, n: int, flights: List[List[int]], src: int, dst: int, K: int) -> int: | |
flight_map = defaultdict(list) | |
for start, end, price in flights: | |
flight_map[start].append([end,price]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import defaultdict | |
import heapq | |
def findCheapestPrice(self, n: int, flights: List[List[int]], src: int, dst: int, K: int) -> int: | |
flight_map = defaultdict(list) | |
for start, end, price in flights: | |
flight_map[start].append([end,price]) |