Company: Goldman_Sachs_12nov
Difficulty: medium
Dora's Preferred Route Problem Description Dora loves bike riding, and every weekend she plans a trip. This weekend she is riding from her source city S to a destination city D . Several other cities lie nearby, and she wants the route that lets her visit as many cities as possible on the way, visiting any city at most once. Her map is a graph G whose nodes are cities and whose edges are roads. Given G as an adjacency matrix, the number of cities n (labelled 0 to n-1 ), the source S and the destination D , print the route from S to D that visits the greatest number of cities, listing the cities in the order they are visited. When several routes visit that same greatest number of cities, print the lexicographically smallest one. Print nothing else. Any extra text becomes part of the output and the test cases fail. Input Format The first line contains one integer n , the number of cities. Each of the next n lines contains n space-separated integers, either 0 or 1, forming the adjace