I tried to handle all possible cases but still I am get WA in 3 testcases.
This is my code:
Getting WA in 3 testcases
Hello @ansh0811,
-
The usage of the visited array is incorrect.
-
As you have to maximize the CB numbers, so first check for CB numbers of smallest size i.e. 1 and then gradually increase the size.
You may refer to the following code for better understanding:
Hope, this would help.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.