C# how to find all combinations in an array for adding

前端 未结 0 540
名媛妹妹
名媛妹妹 2021-01-29 12:09

I have an array with elements [1, 2, 3, 4], how do I find different combinations to add? The output should be:

1+2, 1+3, 1+4, 2+3, 2+4, 3+4, 1+2+3, 1+2+4, 1+3+4, 2+3+4, 1

相关标签:
回答
  • 消灭零回复
提交回复
热议问题