/**
 *	Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.
 *
 *	push(x) -- Push element x onto stack.
 *	pop() -- Removes the element on top of the stack.
 *	top() -- Get the top element.
 *	getMin() -- Retrieve the minimum element in the stack.
 *
 *	Author: matao
 */

public class MinStack {
	public static void push(int x) {
        
    }

    public static void pop() {
        
    }

    public static int top() {
        
    }

    public static int getMin() {
        
    }

    public static void main(String[] args) {
    	
    }
}
@@ -311,16 +311,41 @@
 ao%0A */%0A%0A
+import java.util.Stack;%0A%0A
 public c
@@ -364,104 +364,483 @@
 k %7B%0A
+%0A
 %09p
-ublic static void push(int x) %7B%0A        %0A    %7D%0A%0A    public static void pop() %7B%0A        
+rivate static Stack%3CInteger%3E dataStack = new Stack%3CInteger%3E();%0A    private static Stack%3CInteger%3E minStack = new Stack%3CInteger%3E();%0A     %0A    public static void push(int node) %7B%0A        dataStack.push(node);%0A        if(minStack.isEmpty() %7C%7C minStack.peek() %3E node) %7B%0A            minStack.push(node);%0A        %7D else %7B%0A            minStack.push(minStack.peek());%0A        %7D%0A    %7D%0A     %0A    public static void pop() %7B%0A        dataStack.pop();%0A        minStack.pop();
 %0A    %7D%0A
+     
 %0A   
@@ -866,39 +866,68 @@
 top() %7B%0A        
+return dataStack.peek();
 %0A    %7D%0A
+     
 %0A    public stat
@@ -948,24 +948,47 @@
 ) %7B%0A        
+return minStack.peek();
 %0A    %7D%0A%0A    
@@ -1032,17 +1032,137 @@
 ) %7B%0A
-    %09%0A    
+%09%09MinStack mStack = new MinStack();%0A%09%09mStack.push(2);%0A%09%09mStack.push(3);%0A%09%09mStack.push(4);%0A%09%09System.out.println(mStack.getMin());%0A%09
 %7D%0A%7D

add Min Stack solution