R9 Found at last

testcase 3 giving runtime error:
code in java:

import java.util.;
import java.io.
;
public class Main {
public static int idx(int arr[],int si,int data)
{
if(si==arr.length) return -1;
int index=idx(arr,si+1,data);
if(index==-1)
{
if(arr[si]==data)
{return si;}
else {return -1;}
}
else return index;

}
public static void main(String args[])throws IOException {
    BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
    int n=Integer.parseInt(br.readLine());
    int a[]=new int[n];
    String l[]=br.readLine().trim().split("\\s+");
    for(int i=0;i<n;i++)
    a[i]=Integer.parseInt(l[i]);
    int d=Integer.parseInt(br.readLine());
    int z=idx(a,0,d);
    System.out.println(z);

}

}

Hey @aritro_ry,
This is an error with the input string. Submit your code using scanner. Since it is a number format exception, there’s a " " char after the input. So, please use scanner class to take input.