6 kyu

Follow that Spy

50 of 2,086adromil

Description:

We are diligently pursuing our elusive operative, Matthew Knight, who also goes by the alias Roy Miller. He employs a nomadic lifestyle to evade detection, constantly moving from one location to another, with each of his journeys following a perplexing and non-standard sequence of itineraries. Our mission is to decipher the routes he will undertake during each of his voyages.

Task

You've been provided with an array of itinerary routes, decipher the precise destinations he will visit in the correct sequence according to his meticulously planned itineraries.

Example

Based on the provided routes:

[ [USA, BRA], [JPN, PHL], [BRA, UAE], [UAE, JPN] ]

The correct sequence of destinations is:

"USA, BRA, UAE, JPN, PHL"

Note:

  • You can safely assume that there will be no duplicate locations with distinct routes.
  • All routes provided will have non-empty itineraries.
  • There will always be at least one (1) route connecting one waypoint to another.
Algorithms

Similar Kata:

More By Author:

Check out these other kata created by adromil

Stats:

CreatedFeb 7, 2017
PublishedFeb 13, 2017
Warriors Trained5655
Total Skips205
Total Code Submissions9021
Total Times Completed2086
Objective-C Completions50
PHP Completions112
Java Completions336
JavaScript Completions873
Swift Completions95
Rust Completions54
TypeScript Completions97
Python Completions470
C++ Completions76
Haskell Completions8
Total Stars151
% of votes with a positive feedback rating94% of 358
Total "Very Satisfied" Votes324
Total "Somewhat Satisfied" Votes27
Total "Not Satisfied" Votes7
Total Rank Assessments10
Average Assessed Rank
5 kyu
Highest Assessed Rank
4 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • adromil Avatar
  • jhoffner Avatar
  • imjasonmiller Avatar
  • JohanWiltink Avatar
  • tachyonlabs Avatar
  • barnasm Avatar
  • Schulzkafer Avatar
  • mauro-1 Avatar
  • tobeannouncd Avatar
  • cwps Avatar
Ad