Sir, is my code correct?

here is my code --> https://ide.codingblocks.com/s/452387

is space complexity fine ?

hello @chandreshmaurya

yeah u are using only 3 size array, it is fine.

try to do it using 2 pointer…

sir, please send me the solution of 2 pointer method.

pls check this->link

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.