not sure with input statement some of the testcases are failed
code used
import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner scan=new Scanner(System.in);
int temp=0;
int N=scan.nextInt();
int s[] =new int[N];
boolean flag=false;
for(int i=0;i<N;i++)
{
s[i]=scan.nextInt();
}
for(int i=0;i<s.length-1;i++)
{
if(s[i]<s[i+1])
{
temp=s[i];
s[i]=s[i+1];
s[i+1]=s[i];
flag=true;
}
else
{
flag=false;
break;
}
}
if(flag==true)
{
System.out.println("true");
}
else
{
System.out.println("false");
}
}
}