Twitter: Dodgeball Team and Bipartite Graph

Problem: