graph problem — counting rooms

Revision en3, by moghit_ad, 2021-11-11 02:09:37

hi everyone this is my first time trying to solve a graph problem after learning a DFS algorithm i tried to solve this one on cses but it giving WA on some test cases can anyone tell me where's prob on my code ? here's my code:https://pastebin.com/5hDaJbY4

Tags dfs, bfs, graph

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English moghit_ad 2021-11-11 02:09:37 866
en2 English moghit_ad 2021-11-11 02:07:24 22
en1 English moghit_ad 2021-11-11 00:29:28 1151 Initial revision (published)