




Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
If there is a common path with length x, there is for sure a common path of length y where y < x.
We can use binary search over the answer with the range [0, min(path[i].length)].
Using binary search, we want to verify if we have a common path of length m. We can achieve this using hashing.