← All questions
Coding
Minimum Cost Walk in Weighted Graph
Asked at
Meesho
1Give yourself 5 minutes
2Answer out loud, not in your head
3Then compare with the answer below
0
Stuck? Show a way to structure it+
- 01Ask how a walk's cost is combined
- 02Identify whether revisits are allowed
- 03Group nodes by connectivity with DSU
- 04Aggregate the component invariant
- 05Answer disconnected and same-node cases separately
Reference answer
Then expect these follow-ups
Why can revisiting edges only decrease a bitwise AND?
Tests: correctness reasoning
How would the problem change for simple paths?
Tests: constraint adaptation
Free to read · better with Enzo
Practice this out loud with Enzo
Enzo runs it as a mock interview, pushes back with follow-ups, and grades you on the rubric.
Next question