I would like to compare each element of one array to all elements of another array. What I want to achieve is if an element exists in another array, result =0, otherwise result =1
int m,n;
for(int i=0; i<m; i++) {
for(int j=0; j<n; j++) {
if(i==j) {
result =0;
//perform a task
break;
}
if(i!=j) {
result = 1;
//perform another task
break
}
}
}
however, i fail to achieve what i want in the second if ()
{1, 2, 3}and{4, 5, 6}, would you like the 'no match' task to run once or 9 times?