Uber SDE 2 Interview Round 1 (Elimination)
Anonymous User
1140

There are n people

Each can create group and add people on group and go on trip but you need to make sure that each person can make a group with minimum of L and maximum of M person excluding himself.

A person can be part of the group or can join other groups. Write maximum number of people who can go on trip.

For example L:[1,1,1] M:[1,1,1] so there are total 3 people(A,B,C), lets say if A person creates a group than [A,B] can form group and go on trip. As the condition satisfies for both of them that is A needs minimum and maximum 1 person to go and B also needs minimum 1 and maximum 1 person go. Now C is left all alone cannot form group as he needs minimum 1 person to go on trip and maximum 1 person to go on trip.

Not able to think approach.

Comments (5)