Given 3 integer arrays: A=[1,3,-1], B=[2, 4, 0, 5], and C=[3, 6, 7], find all pairs of elements (one from A, one from B, we have to use elements in

both arrays), such that the sum is from C

My Solution:

```
// takes O(n^3)
for( i= 0; i< A.length-1; i++)
for( j= 0; j<B.length-1; j++)
{
for(int p= 0; p< c.length-1 ; p++ )
{ if((A[i]+B[j])= c[p])
System.out.println(“Pairs: “+ A[i]+” ”+B[K]);
}
}
```