Medium · Graph
BFS Shortest Path
Explore a graph in breadth-first order to reach a target.
Reference test case
Input: [2, 7, 11, 15], target = 9 Expected output: [0, 1]
Medium · Graph
Explore a graph in breadth-first order to reach a target.
Input: [2, 7, 11, 15], target = 9 Expected output: [0, 1]