since we are using vector to make the stack, can we directly traverse the stack using index and compare each value to get min and max rather than making 3 stacks.
Min stack/max stack
hi @dhruvj797,
u can do that but the time complexity would increase, in interview u may be asked to reduce so use this approach
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.