Only one test case is passed

hi rachit
your code fails at the following test case
4
1 1 1 2
your output:1 1 1 1
expected output:1 1 1 2

Not to able to remove this error…Please correct the code as the case 12221 is working

Its been 3 days since I raised this doubt…Will someone please look into this?

i have provided you the pseudo code for your reference.
you can go through the pseudo code and then you will be able to rectify the error

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.