The Shortest Route
A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- medium
- Seniority
- L4
Problem
Given a directed graph as adjacency list dict, and two node names, return the minimum number of edges from start to end, or -1 if unreachable.
Summary
Fewer hops is always better.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and grades it automatically.