Getting an error
Hey @Sadaf_khan0107
just a change
while (!stack.isEmpty()) {
stack.pop();
System.out.print(-1);
}
instead of
while (!stack.isEmpty()) {
System.out.print(-1);
}
Still your logic is wrong
We are given a circular array, print the next greater number for every element.
You are doing nothing for the circular array,
still having some compilation error