Increasing decreasing sequence

import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int[]num=new int [n];
int count = 0 , temp=0;
for (int i=0;i<n;i++)
{
num [i] = scan.nextInt();
}
for(int i = 0 ; i<n-1 ; i++)
{
if(count == 0)
{
if(num[i]>num[i+1])
{
count++;
}
}
else if(count>1)
{
break;
}
}
if(count==0||count==1)
{
System.out.println(“true”);
}
else
{
System.out.println(“false”);
}
}
}

CODE IS NOT RUNNNING

Add count==1 condition

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.

where have to put that condition