This is my function for storing all the occurrences.
int storeocc(int *a, int i, int j, int n, int *out, int key){
if(i==n){
return j;
}
if(a[i]==key){
out[j]=i;
j++;
}
storeocc(a, i+1, j, n, out, key);// here i didn't right return
}
However, in the video, it has a return part there. I want to ask whether it is necessary or not to write the return part.