Something similar to LeetCode 886. Possible Bipartition
Implement possible_bipartition(n, dislikes), where n people are labeled from 1 to n and each dislike pair must belong to different groups. Return True if a valid two-group assignment exists, otherwise return False.
The input is an integer n and a list of two-element lists; the output is a Boolean.
def possible_bipartition(n, dislikes):