Graph Theory37 sections · 1633 units
Open in Course

LeetCode 886 Possible Bipartition - Problem Statement

LeetCode 886

You have nn people labeled 11 to nn. You are given a list of pairs where each pair [a, b] means person aa dislikes person bb (and bb dislikes aa). 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?