#include<bits/stdc++.h>
using namespace std;
int lastOccurence(int arr[],int i,int key)
{
if(i==0)
return -1;
if(arr[i]==key)
return i;
return lastOccurence(arr,i–,key);
}
int main()
{
int n;
cin >> n;
int arr[n];
for(int i=0;i<n;i++) cin>>arr[i];
int key;
cin >> key;
int ans = lastOccurence(arr,n-1,key);
if(ans)
cout<<ans<<endl;
else
cout<<"-1"<<endl;
return 0;
}
where am i doing wrong