Even the complete solution is wrong!


#1

if(!s.empty() and A[i]>s.top) is WRONG it should be WHILE LOOP rather than IF LOOP…