One test case is failed

i have tried long long int but still i think it is unable to access
the element between 10^-9 to 10^9

code:
using namespace std;
#include
#define ll long long
int Last_Occurance(ll int a[],int n,ll int m,int i,int index)
{
if(n==0)
{
return index;
}
if(a[i]==m)
{
index=i;
}
return Last_Occurance(a,n-1,m,i+1,index);
}
int main()
{
int n;
ll int m;
cin>>n;
ll int a[n];
for(int i=0;i<n;i++)
cin>>a[i];

cin>>m;

cout<<Last_Occurance(a,n,m,0,0);

}

@n.nishchaya2000 ok wait let me check your code

@n.nishchaya2000 just pass the value of index -1 instead of 0 as in case of not found answer is -1.
i hope your doubt is cleared if yes don’t forget to mark the doubt as resolved :smiley: