You are viewing a single comment's thread. Return to all comments →
Instead of a sparse array, store the sum in a HashTable. And then in the second pass check if the element value is present as a key.
Seems like cookies are disabled on this browser, please enable them to open this website
Pairs
You are viewing a single comment's thread. Return to all comments →
Instead of a sparse array, store the sum in a HashTable. And then in the second pass check if the element value is present as a key.