You are viewing a single comment's thread. Return to all comments →
for this question if u use dequeue data structure it can be solved in O(1) per query.
Seems like cookies are disabled on this browser, please enable them to open this website
Queue using Two Stacks
You are viewing a single comment's thread. Return to all comments →
for this question if u use dequeue data structure it can be solved in O(1) per query.