# Given a bunch of integer numbers, please output all combination of all possible numbers by using plus operation only

Given a bunch of integer numbers, please output all combination of all possible numbers by using plus operation only.

For example,

[10, 20] => [10, 20, 30]

[1, 2, 3] => [1, 2, 3, 4, 5, 6]

[10, 20, 20, 50] => [10, 20, 30, 40, 50, 60, 70, 80, 90, 100]

Could someone help me with a method to do that in Java ?

I have made tries and I think it works, but looking for other solutions.

public int[] getCoins2(int[] coins) {

Set

for (int coin : coins) {

result.addAll(result.stream().map(value -> value +...

By: StackOverFlow - Tuesday, 20 November

# Related Posts

- Older News
- Navigation drawer with different Tab Bar programmatically StackOverFlow (Today) - I want to make a design like the first photoalways using navigation drawer, but when i select another fragment from this menu (nav drawer) the tab bar will change for...
- find minimum number of ids after removing certain number of items StackOverFlow (Today) - I am working on below problem but I am getting wrong answer for it:Task is to sell the items given to her in a bag where each item has anID...
- counting loops in array [on hold] StackOverFlow (Yesterday) - I've got a, imo, quite complicated task to complete for my university. I am new to java so pls take this in reconsideration before you flame me ty :)So the...
- I don't know how to solve this "ArrayIndexOutOfBoundsException" error StackOverFlow (Yesterday) - ı created nested loop to implement integers in my String array : int ı = 0;String[] haha = new String[sizeFinder(numbers)];for (int q = 0; q < sizeFinder(numbers);) {for (ı =...
- Table number spinner StackOverFlow (Yesterday) - Im trying to implement a table with 3 rows and 6 columns, each column will consist of numbers up to 50 and it can be spinned around to pick a...
- I created decimal to binary method and I want to use it in 2D array but I can't StackOverFlow (Yesterday) - I created simple decimal to binary method like this :public static int[] convertDectoB(int number, int size) {int binary[] = new int[size];for (int a = number; a > 0 && size...
- Test if code contains three digits in order in Array. StackOverFlow (Yesterday) - Directions:Write a code that determines whether A, B, and C appear consecutively and in order exactly once in the numbers array and return the result. Example:Suppose A is 1, B...
- Honeypot sample test Odd Numbers question StackOverFlow (Yesterday) - So there is a Sample Test publicly available on the Honeypot site, and I'm confused about one of the tests.1
- Bingo Board using unique random numbers (JAVA) StackOverFlow (2 days ago) - I am trying to output a bingo board with random numbers (without using arraylists or hashes) from 11-89, and my code sometimes works and sometimes it does not so I...
- My code keeps printing "null" with the actual output value [duplicate] StackOverFlow (2 days ago) - This question already has an answer here:Why does a null value appear in string output?3 answersI am trying to print numbers in the string. I created array for storage these...