Increasing decreasing sequence

whats wrong with the code its saying one of the test case is wrong
#include
#include
using namespace std;
int main() {
long long int no,mi,ma;
int i=0,n;
mi=INT_MAX;
ma=INT_MIN;
cin>>n;
while(n>0)
{
cin>>no;
if(i==0){
mi=min(mi,no);
if(mi==no){
n–;
continue;
}
else{
i++;
} }
if(i==1){
ma=max(ma,no);
if(ma==no)
{
n–;
continue;

           }
           else{i++;
            }
       }
       n--;
      
       }   
       if(i==1){
           cout<<"true";
       }
       else{
           cout<<"false";
       }
 return 0;

}

hello @pushaansharma

pls save ur code at cb ide and share its link with me

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.