Why it is not passing all test cases

#include
using namespace std;
int main() {
int n;
cin>>n;
int e,p,inc=0;
cin>>p;
n–;
while(n>0){
cin>>e;
if(e==p){
cout<<“false”;

	}
	if(e<p && inc==1){
		cout<<"false";

	}
	else if(e>p){
		inc=1;

	}
	p=e;
	n--;
}
cout<<"true";

return 0;

}

hey , your code isn’t readable here. You can share this code using ide.codingblocks.com

  • A special url will be generated, share that url with me

Screenshot 2021-03-10 at 11.17.37 AM

logic is right, it’s just issue with the implementation. Implement it like this

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.