Unequal teams CODENATION


sample case:

My approach … first divide the N members into 2 teams consisting of N/2 members each or let there be 1 extra member in any team, then after the first match exchange N/4 members from each team , then exchange N/8 members and so on until all members have played against each other.
After each game you should take care of the extra remaining people if you can’t divide them into two equal groups .
This way you will get the number of matches and after that you just need to check whether you can play these many matches or not.
I am not totally sure about my answer though but I think this should work.

1 Like

Your approach is correct the answer would come out to be ceil(log(n))

we can find the solution if log2(n) is less than 2 times x then print 1else print 0

Can anyone share the link to solution of remaining 2problems?

When was test held ? How do you came to know about it?

On campus

Can you please tell me the intuition behind it?

How come we know about this?