On Oct 27, 8:21 am, "MOHIT ...." <[email protected]> wrote: > @ruturaj : but for that hash table you have to know range?? Nope we dont need the range.
#include<map> map <int, int> hash; for(int i=0;i<n;i++) if(hash[m-a[i]] > 0)count++;hash[a[i]]++; does the trick. -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
