Bookmyshow interview question

Check if graph is bipartite