Ques - Minimum total no. of edges A and B together will go through to reach D in undirected and unweighted graph. There will be other nodes as well. The path may or may not be colliding depending on the test cases.
I couldn't think of any optimal solution for this except the brute force of finding all the paths and then comparing, which the interviewer told will be too costly. Can anyone share the optimal solution for this?
Comments (5)


