I need to design a data structure that supports the following:

`getMinElement`, `getLastElement`, `insertElement`, `deleteLastElement` - in `O(1)` run time.

Memory is bounded by n **(not O(n))** i.e. You can keep at most n elements at a given moment. plus O(1) memory.

(Important: pointers are regarded as 1 as well, so linked list, for instance, is out of the question).

Example:

```
insert(6)
min() -> 6
insert(10)
insert(5)
min() -> 5
insert(7)
delete()
min() -> 5
delete()
min() -> 6

```