Hi,

I have used hash table(unordered_multimap) to store 2-number sum and their indices, and get 4 numbers when the sum of two 2-number sums is equal to target value. Checked the indices to keep 4 numbers are distinctive which means one number which has a certain index can not be used twice. Sorted 4 numbers and pushed to set to make the quadruplet unique. However, it got TLE.

I have 2 questions.

- Does this method using hash table have quadratic performance? Is this a correct way?
- Can you give an algorithm that has better performance and get accepted?

Thanks a lot!