Depth-First Search
886. Possible Bipartition
Given N people and a list of mutual dislikes, can you split everyone into two groups so no two people who dislike each other share a group? This is graph bipartiteness in disguise — dislikes are…
Loading…