You have people labeled to . You are given a list of pairs where each pair [a, b] means person dislikes person (and dislikes ). Can you split everyone into two groups such that no two people in the same group dislike each other?
Return true if possible, false otherwise. Before reading on, think: how is this related to bipartite graphs?
What do the "dislikes" represent in graph terms?