Why isnt my one testcase passing?

what is wrong in my code ?

for input
7
100 80 60 70 60 75 85

your output is
1 1 1 3 1 5 7

but correct output is
1 1 1 2 1 4 6

There two mistake in code

  1. condition you have use is wrong
    correct condition is while(!s.empty()&& a[s.top()]<=currPrice){
  2. second is modified in code

Modified Code

i hope this help
if you have more doubts regarding this feel free to ask
if your doubt is resolved mark it as resolved from your doubt section inside your course