Link to the problem Link to my source code I tried to solve this problem using double DFS but getting a runtime error. Please help me with figure it out
**The problem was initiating the dynamically allocated dist array. This is what expected to be written memset(dist,-1,sizeof(int)*(N+1)) instead of memset(dist,-1,sizeof(dist)) **