Find out all the elements in A and B such that the A[i]B[j]=C[k]

You have been given three arrays A,B and C.
You have to find out all the elements in A and B such that the A[i]-B[j]=C[k]

A:

1. Put all the elements of array C in a HashTable - O(n) time and O(n) space
2. Calculate all the possible differences of A[i] and B[j]. and check whether diff is present in HT or not. O(n^2) time and O(1) space

原文地址:https://www.cnblogs.com/yayagamer/p/2512327.html