Possible Bipartition
Medium
Graph Algorithms (Advanced)
n people are labelled 1..n and some pairs dislike each other. Print true if the people can be split into two groups so that no two people who dislike each other are in the same group.
Constraints
1 <= n <= 2000 0 <= m <= 10^4
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.