import java.util.*; public class Solution { Stack stack = new Stack(); Stack minStack = new Stack(); int min=Integer.MAX_VALUE; public void push(int node) { stack.push(node); if(node<=min){ min=node; } minStack.push(min); } public void pop() { stack.pop(); minStack.pop(); } public int min() { return Integer.parseInt(minStack.peek().toString()); } }