i have submitted the code please see to it iam not able to find out the problem i have included the scanner and added throws Exception at main as well .but still throwing the exception
No such element found
@Chitwan,
Did you select the correct language while submitting because in your submissions there is an empty template of C++ code.
Yes I have submitted it in Java
how do i have to share
i shared it again ,is it visible now?
static boolean isSorted(int arr, int n) {
if (n == 0 || n == 1)
return true;
if (arr[i - 1] > arr[i])
return false;
return isSorted(arr, n - 1);
}
In this code, you have not initialized i. Also, declare arr as an array. It is declared like an int.
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.