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

@Monu-Singh-480654572341490
why logic is still 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

@Sadaf_khan0107
logic is fine just a change
I commented in your code

thnkss @Monu-Singh-480654572341490