Possible Bipartition

Medium · Graphs · about 20 minutes

Asked at LinkedIn, Amazon, ByteDance, Snowflake, Google, Confluent.

You want to split people 1..n into two groups. dislikes[i] = [a, b] means a and b must be in different groups. Return true if such a split exists.

Related guides