Vivek and party


My code is not passing all the test cases. May I know the mistake

Your code is correct
There are multiple answers for this question
Your is also correct
But to get 100 you need to output according to CB Solution
You can just open this question in another contest and hardcode the answer to get marks since your approach is correct