Stack implementation with currentMax O(1)