How to make all possible sum combinations from array elements in VB

Posted by Elma on Stack Overflow See other posts from Stack Overflow or by Elma
Published on 2010-03-24T16:26:51Z Indexed on 2010/03/30 4:23 UTC
Read the original article Hit count: 337

Filed under:
|
|
|

If there is an array with elements: 1,2,3,4, the program should return another array with sum of all combinations:

1
2
3
4
3 (1+2)
4 (1+3) 
5 (1+4)
5 (2+3)
6 (2+4)
7 (3+4)
6 (1+2+3)
7 (1+2+4)
8 (1+3+4)
9 (2+3+4)
10 (1+2+3+4)

© Stack Overflow or respective owner

Related posts about vb

Related posts about arrays