test case 0 is failing
import java.util.*;
public class Main {
public static void main(String args[]) {
// Your Code Here
Scanner scn = new Scanner(System.in);
int n = scn.nextInt();
int [] arr = new int[n];
for(int i = 0; i < arr.length; i++){
arr[i] = scn.nextInt();
}
System.out.println(isSorted(arr, 0));
}
public static Boolean isSorted(int[] arr, int i){
Boolean ans = true;
if(i >= arr.length-1){
return true;
}
if(arr.length==1){
return true;
}
if(arr[i] > arr[i+1]){
ans= false;
}else{
isSorted(arr, i+1);
}
return ans;
}
}