Is there more efficiant way of doing?

hi @deepaksehrawat150_50930f2fcb83f47e
another approach can be maintain a

map<int,vector<int>> m;

where it stores elemets according to level… and after u have all the elements stored in map, print the result in which on every second level, print the elements in the reverse order…

hi @deepaksehrawat150_50930f2fcb83f47e
is there anything else?? or shall i mark the doubt as resolved??

i don’t know about maps till now,is there a anothere way

@deepaksehrawat150_50930f2fcb83f47e
refer this -->

1 Like

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.