Facebook | Phone | Split profiles into two groups
Difficulty: MEDIUMCategory: InterviewExperienceFrequency: 1Asked On 2020-03-12Added By Anonymous
Source: Link
Company: Meta
Role: unknown
Interview Stage: Phone Screen
Location: unknown
Year: unknown
Original Post Content:
There is a set of social profiles. Some of them are connected.
Is it possible to split the set into two groups, such that there are no connections inside the group?
// A B C
// A-B B-C [A, C] [B] true
// A-B B-C A-C [A, C] [B] false
// input [[A,B] [B, C]] output true
// input [[A,B] [B, C], [A, C]] output false
I've found a similar question https://leetcode.com/problems/possible-bipartition/