You are given n people, labeled from 1 to n.
Each person may dislike some other people, and two people who dislike each other cannot be placed in the same group.
Your goal is to determine whether it’s possible to split all people into two groups such that no two people who dislike each other are in the same group.
Return True if such a bipartition is possible, otherwise False.
Input: n = 4 dislikes = [[1,2],[1,3],[2,4]]
Output: True
Input: n = 3 dislikes = [[1,2],[1,3],[2,3]]
Output: False
Accepted:
Submission: