Infosys interview question

First question is like bipartite graph.