sir what can do to submit my code
#include
using namespace std;
int lastindex(int *arr,int n,int m, int i){
if(i==n){
return -1;
}
int rr = lastindex(arr,n,m,i+1);
if(rr == -1 and arr[i] == m){
return i;
}else{
return rr;
}
}
int main(int argc, char const *argv[])
{
int n,m;
cout<<“enter the size of the array”;
cin>>n;
cout<<“enter the element of an array”;
int *arr = new int[n];
for(int i=0;i<n;i++) {
cin>>arr[i];
}
cout<<“enter the element to search”;
cin>>m;
cout<<lastindex(arr,n,m,0);
return 0;
}