My issue
I am not getting the problem
My code
static final int MAX_SIZE = 101;
static int[] a = new int[MAX_SIZE];
static int top = -1;
static void push(int ele) {
if (top <= MAX_SIZE - 1) {
top++;
a[top] = _0_;
System.out.println("Pushed: " + _101____);
} else {
System.out.println("Stack is full. Cannot push: " + _101____);
}
}
static int pop() {
if (top >= 0) {
int ele = a[_0_];
top--;
System.out.println("Popped: " + ele);
return ele;
} else {
System.out.println("Stack is empty. Cannot pop.");
return -1;
}
}
Learning course: Stacks and Queues
Problem Link: Push and Pop Practice Problem in Stacks and Queues - CodeChef