DFS doubt please help

qstn :http://www.spoj.com/problems/PARADOX/

can anyone please help me giving a detail tutorial. i mean why to use DFS??

I found solution in this link but can’t understand

Thank you

Go through this link…hope this helps…:slight_smile:

P.S.: Not only for dfs…this site will help you with many algorithms!!!

I know DFS but problem is that why to apply for this qstn not how to apply?