Here is the code for checking if array is sorted or not using recursion but one of my test cases is coming wrong, what can be the reason for this?

def isSorted(arr):

  if len(arr)==1 or len(arr)==0:
	  return True
  if arr[0]<arr[1] and isSorted(arr[1:]):
	  return True
  return False

n=int(input())

arr=[int(i) for i in input().split()]

if isSorted(arr):

  print('true')

else:

  print('false')

hello @mehul.ai

use <= in place of <

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.