2 Sum Problem : Given an integer array and a number T, find all unique pairs of (a, b) whose sum is equal to T
how to build the hash table in the approach 3. als… Unknown - Feb 3, 2014how to build the hash table in the approach 3. also i think you should check if hash(T-arr[i]) is empty first.
This comment has been removed by the author.
Hi Jianchen, I think we can use hashmap or we can use element as an index in the array. I think only way hash() is empty when the given array is null or has no element.
[Read More]