Whats Wrong in my Solution

Scanner scn = new Scanner(System.in);
	
	int n = scn.nextInt();
	
	int[] a = new int[n];
	
	int si=0;
	
	for(int i =0 ; i<n ; i++) {
		
		a[i] = scn.nextInt();
		
	}
	
	boolean sa =compareArray(a,si);
	System.out.println(sa);
}


static boolean compareArray(int[]a, int si) {
	
	if(a.length-1==si) {
		return true;
	}
	
	
	if(a[si]>a[si+1]) {
		return false;
	}else {
		
		boolean ans = compareArray(a,si+1);
		return ans;
	}
	
	
}

}

what is your solution for? Is it checking if the array is sorted in ascending fashion?
If yes, your solution is correct for increasing array but not for strictly increasing array.
if you need a strictly increasing array, you must write if(a[si]>=a[si+1]) return false;

Thanks

please resolve it and rate it if satisfied.
Thanks.

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.