Skip to content

Latest commit

 

History

History
14 lines (9 loc) · 765 Bytes

(6 kyu) Follow that Spy.md

File metadata and controls

14 lines (9 loc) · 765 Bytes

Follow that Spy (6 kyu)

https://www.codewars.com/kata/follow-that-spy/

We are tracking down our rogue agent Matthew Knight A.K.A. Roy Miller and he travels from places to places to avoid being tracked. Each of his travels are based on a list of itineraries in an unusual or incorrect order. The task is to determine the routes he will take in his every journey. You are given an array of routes of his itineraries. List down only the places where he will go.

Example:

routes = [[USA, BRA], [JPN, PHL], [BRA, UAE], [UAE, JPN]]
result: "USA, BRA, UAE, JPN, PHL"

NOTE: It is safe to assume that there will be no repeating place with different route and there are no empty routes and could have at least one (1) route (from one waypoint to another).