← Questions

Reach a destination by bus with limited walking

0
AmazonCodingLast asked Aug 2025

You get start and end points on a grid, a walking budget k, and bus routes between pairs of stations, all two-way. Riding a bus costs no walking; walking between points costs their Manhattan distance. Decide whether you can get from start to end by mixing bus rides and at most k of walking. Agree with the interviewer whether k is per walk or in total.

Write and test your solution herePython in your browser, the question's tests level by level, every submission kept for you.Sign in to start coding