All contents and pictures on this website come from the Internet and are updated regularly every week. They are for personal study and research only, and should not be used for commercial purposes. Thank you for your cooperation.
Given a set of N
people (numbered 1, 2, ..., N
), we would like
to split everyone into two groups of any size.
Each person may dislike some other people, and they should not go into the same
group.
Formally, if dislikes[i] = [a, b]
, it means it is not allowed to put the people
numbered a
and b
into the same group.
Return true
if and only if it is possible to split everyone into two groups
in this way.
Difficulty:
Medium
Lock:
Normal
All contents and pictures on this website come from the Internet and are updated regularly every week. They are for personal study and research only, and should not be used for commercial purposes. Thank you for your cooperation.