Solving Bus Routes in go. Please try yourself first to solve the problem and submit your implementation to LeetCode before looking into solution.

Problem Description

Example:
Input: 
routes = [[1, 2, 7], [3, 6, 7]]
S = 1
T = 6
Output: 2
Explanation: 
The best strategy is take the first bus to the bus stop 7, then take the second bus to the bus stop 6.

Note:

  • 1 <= routes.length <= 500.

  • 1 <= routes[i].length <= 500.

  • 0 <= routes[i][j] < 10 ^ 6.

  • 1 <= routes.length <= 500.

  • 1 <= routes[i].length <= 500.

  • 0 <= routes[i][j] < 10 ^ 6.

See the full details of the problem Bus Routes at LeetCode

Originally posted at: @github.com/halfrost/LeetCode-Go