Strongest Fighter Problem

3 test cases arent passing
this is my code

Hello @hrithik-1 check thisis the corrected code:

could you tell me where i went wrong

@hrithik-1 firstly the array size could be of size 1e7 at max so in main (locally) we can declare the max of 1e6.
secondly when you are popping from the front check with the condition.
rest all is fine.

so c++ doesn’t allow more than 10^6 as a local variable in a function but aas a global variable it can go to higher limits because the compiler crashes?

@hrithik-1 yes right.

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.