I am solving this question : I am using BFS and connected component, why I am getting sigsegv error, I don’t know, please check my code
Got Accepted Problem was in resetting the value of mat and mark.
Cool … I could not figure that out either