This is an assignment testing knowledge of graph data structure and Depth-first search.
Input: routes = [[5, 0], [6, 0], [7, 1, 0], [8, 1, 0], [9, 1]], source = 5, target = 9
Output: 3
Explanation: One travelling strategy with the least number of trips is to first take Bus 0 (routes[0] = [5, 0]), which takes the commuter from bus stop 5 to bus stop 0, then take Bus 2 (bus stop 0 to 1), and finally take Bus 3 (bus stop 1 to 9). This takes 3 trips.