How to approach

How to approach this without array

Hey @aatish08
This is a simple array question. Please help me understand why you are trying to find another DS for this. Maybe I can help you better then.

Yup i know its an array question,but the explanation part says to not use array or list, That’s why i asked to do this without array

@aatish08
You can actually process the input as it comes, store nothing in the array and process the input on the go. Or you can use stack and queue as well.

If your doubt is resolved please mark it as cleared. Thanks and best of luck !!

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.