If you need to find the numbers you also must store them for output.

```
if (abs(a[i] - b[j]) == num)
{
result1 = a[i];//store in variable with greater scope
result2 = b[i];
return 1;
}
```

What about multiple solutions in the array?But speed isnt the primary problem on that simple task. Such "optimization" often leads to complex and bizarre code which results in strange bugs and problems.

So anything you missed to mention?