Walk in a graph
CodeChefOpen on judge ↗
While your app development you ended up falling in a problem which requires the following graph problem to be solved. Let G be an undirected graph with nodes {0, . . . , n − 1} in which every node has degree at least one. One particle is located at a node u and another at node v. At each step, each particle can move to a node that is adjacent to the node it is currently at. The particle cannot re
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start