hachyderm.io is one of the many independent Mastodon servers you can use to participate in the fediverse.
Hachyderm is a safe space, LGBTQIA+ and BLM, primarily comprised of tech industry professionals world wide. Note that many non-user account types have restrictions - please see our About page.

Administered by:

Server stats:

8.9K
active users

Šimon Tóth

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: compiler-explorer.com/z/ThTove
Solution: compiler-explorer.com/z/n79GE3