Tuesday common C++ interview problem: Bus routes.
Given a list of bus routes, where route[i] = {b1,b2,b3} means that bus i stops at stops b1, b2 and b3; determine the smallest number of buses you need to reach the target bus stop starting at the source.
Return -1 if the target is unreachable.
Solve it yourself: https://compiler-explorer.com/z/ThToveWP8
Solution: https://compiler-explorer.com/z/n79GE31xE