Hi, i'm trying to solve a cool problem but can't figure out how we can do it.
What is the minimum number of $$$moves$$$ to get from $$$x$$$ to $$$z$$$.
Input :
N
X, Y
pairs...
Eg :
5
1 3
1 2
2 4
2 5
5 6
6 3
ANS = 5 : 1,2 — 2,4 — 2,5 — 5,6 — 6,3
if someome please can help me with implementation , it would be cool.