Hello again. Just understood graphs. in this, the author gave a solution of dfs.
I was wondering, as to couldn't it be solved with Breadth First Search? Marking each level as one colour, and the other level as the second colour?
I gave a solution with BFS, but it's giving a wrong output.
Could you please help me out?