Consider an array of unique integers, with an arbitrary length greater than 2. It is sometimes possible to express elements of the array as the sum of at least two other elements. For example, if our array is
[2, 3, 1], we can express
3 as the sum
2+1. However, we can't express either
1 as the sum of other elements.
Additionally, each integer in the list may only be used once in each sum. For example, with
[1, 2, 5] we can't express
1+1+1+2 etc.) as we can only use each element once per sum.
Your program should take such array as input, via any convenient method, and output the elements of the input that are expressible as the sum of other elements. The output may be in any order, as may the input.
This is code-golf, so aim to make your code as short as possible, time / space complexity be damned.
input -> output [2, 3, 1] ->  [8, 2, 1, 4] ->  [7, 2, 1, 4] ->  [7, 2, 1, 4, 6] -> [6, 7] [0, 1, -1] ->  [4, 2, -2, 0] -> [2, 0] [0, 1, 2] -> 
Explanation for the last test case and result: For the purposes of this problem statement, zero cannot be considered the sum of a resulting empty list. Zero can only be in the resulting list IFF two or more other elements of the input list can be added to sum to it.
In other words, do not assume that if 0 is in the input, it should always be in the output - you cannot choose an empty subset to cover it. The problem statement explicitly states that any element in the resulting list must be the sum of other elements.