Skip to content

Commit 5a85da8

Browse files
author
Hamid Gasmi
committed
#302: add description of problem
1 parent b1a3b83 commit 5a85da8

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
"""
2+
1. Problem Summary / Clarifications / TDD:
3+
Directed Graph(V: { Cities }, E: { Flights }, W: { Prices } )
4+
K: Number max stops
5+
Question: Return price of cheapest flight from city "SRC" to city "DST" with at most K stops
6+
7+
With Graph below, SRC: C0, DST: C2
8+
Expected Results:
9+
10+
2 1
11+
C3 ___ C2 <-----
12+
^ \ ^ |
13+
2 | \ | 5 --C4
14+
C0 ---_> C1-----------^
15+
5 1
16+
5 1 1
17+
Expected result for K = 3: 7 (3 Stops: C0 ---> C1 ---> C4 ---> C2)
18+
19+
2 2 1 1
20+
Expected result for K = 4: 6 (4 Stops: C0 --> C3 ---> C1 ---> C4 ---> C2)
21+
22+
2. Intuition:
23+
- Naive:
24+
- We could do better:
25+
26+
3. Implementation
27+
4. Tests:
28+
5. Complexity Analysis:
29+
Time Complexity:
30+
Space Compexity:
31+
32+
"""
33+
34+
class Solution:
35+
36+
def find_cheapest_price(self, cities_count: int, flights: List[List[int]], src: int, dst: int, max_stops_count: int) -> int:
37+
pass

0 commit comments

Comments
 (0)