Skip to content

Latest commit

 

History

History
5 lines (3 loc) · 381 Bytes

File metadata and controls

5 lines (3 loc) · 381 Bytes

Idea behind the solution

The problem does not state any restriction or performance bounds.

It was simply used two stacks, one to stack any enqueued value and the other to be used as a helper, so we transfer every items from one stack to the other, remove the last element from the helper stack and than transfer the elements back to the first stack to keep the enqueued order.