Sir my code is runing perfectly in eclipse but it will not showing output in your ide.
Kindly guide me
import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner s=new Scanner(System.in);
int N=s.nextInt();
int arr[]=new int[N];
for(int i=0;i<N;i++){
arr[i]=s.nextInt();
}
int M=s.nextInt();
System.out.println(foundatlast(arr,0,M));
}
public static int foundatlast(int arr[],int lastindex,int M){
if(arr.length==lastindex){
return -1;
}
int index=foundatlast(arr,lastindex+1,M);
if(index==-1){
if(arr[lastindex]==M){
return lastindex;
}else{
return -1;
}
}
return index;
}
}