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
The code is unreadable, either use the block thing in the toolbar or put the code in pastebin and send the link
Here is My code using DSU , You can refer this https://cses.fi/paste/f3ea0f469366ebbd2b6c58/
P.S. -> first try to solve leetcode number of island problem