Company: bloomberg pune
Difficulty: medium
A railway company operates multiple train lines across the United States. Each train line has: a unique line name, and an ordered list of cities that the train visits. A passenger may: Travel between adjacent cities on the same train line in either direction. Transfer from one train line to another only at a city that appears in both train lines. Make any number of transfers. You are also given multiple travel queries. Each query consists of a source city and a destination city. For every query, determine whether it is possible to travel from the source city to the destination city using the available train lines. Return a vector<bool> where the i-th element is true if the i-th query is possible, and false otherwise. Function Signature struct TrainLine { string lineName; vector stations; }; vector canTravel( vector & trainLines, vector >& queries ); Example 1 Input trainLines = [ { lineName = "Northeast Corridor", stations = [ "Boston", "Providence", "New York", "Philadelphia", "