feat(content): more test cases
This commit is contained in:
@@ -8,6 +8,22 @@ categories:
|
||||
patterns:
|
||||
- dfs
|
||||
|
||||
function_signature: "def find_itinerary(tickets: list[list[str]]) -> list[str]:"
|
||||
|
||||
test_cases:
|
||||
visible:
|
||||
- input: { tickets: [["MUC", "LHR"], ["JFK", "MUC"], ["SFO", "SJC"], ["LHR", "SFO"]] }
|
||||
expected: ["JFK", "MUC", "LHR", "SFO", "SJC"]
|
||||
- input: { tickets: [["JFK", "SFO"], ["JFK", "ATL"], ["SFO", "ATL"], ["ATL", "JFK"], ["ATL", "SFO"]] }
|
||||
expected: ["JFK", "ATL", "JFK", "SFO", "ATL", "SFO"]
|
||||
hidden:
|
||||
- input: { tickets: [["JFK", "KUL"], ["JFK", "NRT"], ["NRT", "JFK"]] }
|
||||
expected: ["JFK", "NRT", "JFK", "KUL"]
|
||||
- input: { tickets: [["EZE", "AXA"], ["TIA", "ANU"], ["ANU", "JFK"], ["JFK", "ANU"], ["ANU", "EZE"], ["TIA", "ANU"], ["AXA", "TIA"], ["TIA", "JFK"], ["ANU", "TIA"], ["JFK", "TIA"]] }
|
||||
expected: ["JFK", "ANU", "EZE", "AXA", "TIA", "ANU", "JFK", "TIA", "ANU", "TIA", "JFK"]
|
||||
- input: { tickets: [["JFK", "A"], ["A", "B"], ["B", "JFK"]] }
|
||||
expected: ["JFK", "A", "B", "JFK"]
|
||||
|
||||
description: |
|
||||
You are given a list of airline `tickets` where `tickets[i] = [from_i, to_i]` represent the departure and the arrival airports of one flight. Reconstruct the itinerary in order and return it.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user