From a given array (call it **numbers[]**), i want another array (**results[]**) which contains all sum possibilities between elements of the first array.

For example, if I have numbers[] = {1,3,5}, results[] will be {1,3,5,4,8,6,9,0}.
there are 2^n possibilities.
It doesn't matter if a number appears two times because results[] will be a [set](http://www.cplusplus.com/reference/set/set/)

I did it for sum of pairs or triplet, and it's very easy. But I don't understand how it works when we sum 0, 1, 2 or n numbers.

This is what I did for pairs :

```
std::unordered_set<int> pairPossibilities(std::vector<int> &numbers) {
    std::unordered_set<int> results;
    for(int i=0;i<numbers.size()-1;i++) {
        for(int j=i+1;j<numbers.size();j++) {
            results.insert(numbers.at(i)+numbers.at(j));
        }
    }
    return results;
}

```

Also, assuming that the numbers[] is sorted, is there any possibility to sort results[] while we fill it ?

Thanks!