← All problemsSign in

Graph-K

Krushna loves graph. He once came across a problem , there were $N$ Nodes , and total $M$ Edges . The graph has both directed and undirected edges in the graph . - If an edge is represented by $D$ then it is Directed ( If there is directed edge between two nodes 1 and 2 then it means that it can go from 1 --> 2 ) and - If it is represented by $U$ then it is Bidirectional edge ( If there

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start