Find greater element(stacks)

showing the correct output but not failing two test cases

i have modified the code a little bit but still failing two test cases

hi @abhinavssr2003_eab0717682969e5c try
5
5 5 5 5 5

ans is -1 -1 -1 -1 -1

okay sir got my mistake…i did’nt handle the equal elements

Changed the code sir…Now one test case is failing

hi @abhinavssr2003_eab0717682969e5c this is a circular array so suppose
10 1 2 3 is array then for 3 ans will be 10 not -1 handle this case