@@ -0,0 +1,878 @@
+package leetcode;%0A%0Aimport java.util.Stack;%0A%0A/**%0A * https://oj.leetcode.com/problems/min-stack/%0A */%0Apublic class Problem155 %7B%0A    public static class MinStack %7B%0A        Stack%3CInteger%3E stack = new Stack%3C%3E();%0A        Stack%3CInteger%3E minStack = new Stack%3C%3E();%0A        %0A        public void push(int x) %7B%0A            stack.push(x);%0A            if (minStack.isEmpty()) %7B%0A                minStack.push(x);%0A            %7D else %7B%0A                if (minStack.peek().intValue() %3E= x) %7B%0A                    minStack.push(x);%0A                %7D%0A            %7D%0A        %7D%0A%0A        public void pop() %7B%0A            int i = stack.pop().intValue();%0A            if (i == minStack.peek()) %7B%0A                minStack.pop();%0A            %7D%0A        %7D%0A%0A        public int top() %7B%0A            return stack.peek();%0A        %7D%0A%0A        public int getMin() %7B%0A            return minStack.peek();%0A        %7D%0A    %7D%0A%7D%0A

Solve problem 155