Skip to content

Instantly share code, notes, and snippets.

View cmattey's full-sized avatar

Chaitanya Mattey cmattey

View GitHub Profile
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])
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])
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])
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])