Add a solution to find whether there are 2 numbers in given array a[] can
be added to match the given number "sum".

the time complexity should be O(n) and elements in the array may be
duplicated.
You can use extra O(n) space as well.