Pregunta de entrevista de Infosys

First question is like bipartite graph.