Given an array and group them as a possible sum

60 views Asked by At

Given an array and group them as a possible sum.

Input Only this array : [1,2,3,4,5]
Output : {[5,1] [4,2]} {[3,2] [4,1]}

Is there any way to solve this problem without using nesting of for loop?

0

There are 0 answers