public class Sortchallenge
{
static Scanner scn=new Scanner(System.in);
public static void main(String[] args)
{
int[] array=takeinput();
System.out.println(isSorted(array, 0));
}
public static int[] takeinput()
{
System.out.println("Enter array size ");
int N=scn.nextInt();
if(N>1 && N<1000)
{
int[] arr=new int[N];
System.out.println("Enter array elements ");
for(int i=0;i<N;i++)
{
arr[i]=scn.nextInt();
}
return arr;
}
else
{
int[] base=new int[0];
return base;
}
}
public static boolean isSorted(int[] arr, int i)
{
if(arr.length-1==i)
{
return true;
}
if(arr[i]>arr[i+1])
{
return false;
}
else
{
boolean restAns=isSorted(arr, i+1);
return restAns;
}
}
}