Print All Paths
easy
1. You are given a graph, a source vertex and a destination vertex. 2. You are required to find and print all paths between source and destination. Print them in lexicographical order. E.g. Check the following paths 012546 01256 032546 03256 The lexicographically smaller path is printed first.
Constraints
None
Format
Input
Input has been managed for you
Output
Check sample output
Example
Sample Input
7
8
0 1 10
1 2 10
2 3 10
0 3 10
3 4 10
4 5 10
5 6 10
4 6 10
0
6
Sample Output
0123456
012346
03456
0346
Question Video