import java.util.*;
public class Main {
public static boolean isSort(int[] arr,int si,int li)
{
if(li==arr.length-1)
{
return true;
}
boolean rr;
if(arr[si]<=arr[si+1])
{
rr=isSort(arr,si+1,li);
}
else
{
rr=false;
}
return rr;
}
public static void main(String args[]) {
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int[] a=new int[n];
for(int i=0;i<n;i++)
{
a[i]=sc.nextInt();
}
boolean result=isSort(a,0,a.length-1);
System.out.println(result);
}
}
Why coding block compiler is giving error. in other compiler it is running properly
here is your corrected code:
if this solves your doubt please mark it as resolved 