Intuition
- Using DFS to recursion the path. And build a map that save the dep. and arr. airports. The value in the map is a minHeap to ensure the lexical order.
solution
|
|
promote
- Can add the airports at last, when the heap is empty, it means the current port is the destination, add it to the path, then jump out this recursion.
- Each add function in the last of the recursion can add the previous port, so add it to the first place in the path.
|
|