Last active
March 5, 2021 04:13
-
-
Save hodgesmr/412f6309c8458e72dcc6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
""" | |
You have a bunch of plane tickets from a recent multi-stop trip you took. | |
You dropped the tickets and they all got shuffled up. | |
Write some Python that takes the list of shuffled tickets | |
Where each ticket is in the format of (source, destination) | |
and reconstruct your trip. Output each city you were in, in chronological order. | |
""" | |
ticket_list = [ ('lax', 'ewr'), ('ord', 'jfk'), ('mia', 'ord'), ('cvg', 'sfo'), ('jfk', 'lax'), ('ewr', 'atl'), ('sfo', 'mia')] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment