Link to problem. It would be very helpful if someone could suggest why my solution gives the wrong answer. I have understood that we have to find whether the graph is bipartite or not, but still I am getting wrong answers. Any help would be appreciated.