# combinatorics – What is the easiest and efficient way to get positive or negative combinations of a list?

Consider the following simple case:

``````list={1,2,2};
Subsets[{Splice[list],Splice[-list]},{1,Length@list}]
``````

This produces the following combinations:

{{1}, {2}, {2}, {-1}, {-2}, {-2}, {1, 2}, {1, 2}, {1, -1}, {1, -2}, {1, -2}, {2, 2}, {2, -1}, {2, -2}, {2, -2}, {2, -1}, {2, -2}, {2, -2}, {-1, -2}, {-1, -2}, {-2, -2}, {1, 2, 2}, {1, 2, -1}, {1, 2, -2}, {1, 2, -2}, {1, 2, -1}, {1, 2, -2}, {1, 2, -2}, {1, -1, -2}, {1, -1, -2}, {1, -2, -2}, {2, 2, -1}, {2, 2, -2}, {2, 2, -2}, {2, -1, -2}, {2, -1, -2}, {2, -2, -2}, {2, -1, -2}, {2, -1, -2}, {2, -2, -2}, {-1, -2, -2}}

The problem I am trying to solve requires me to have all possible combinations of `list` but in any given combination, if an entry appears then it either appears as positive or negative and not both.

So for example `{2, -2, -2}` is invalid since a given `2` should appear as positive or negative but here there are three `2`s appearing even though the original `list` had two `2`s.

Also, I am looking for an efficient way to generate the required combination.