#include<iostream>
//arr1 and arr2 are reference to array of size M and N respectively
template<std::size_t M, std::size_t N>
bool commonValues(char (&arr1)[M], char (&arr2)[N]){
for (int i = 0; i < M; i++){//M USED HERE
for(int j = 0; j < N; j++){//N USED HERE
if (arr1[i] == arr2[j]){
std::cout<<"common element found: "<<arr1[i]<<std::endl;
return true;
}
}
}
return false;
}
int main(){
char arr1[] = {'a', 'b', 'c', 'd', 'z', 'x', 'k', 'l'};
char arr2[] = {'e', 'f', 'g', 'h'};
std::cout<<commonValues(arr1, arr2)<<std::endl;
return 0;
}