Ashish Sahu

Ashish Sahu

  • NA
  • 70
  • 1.7k

Add possible combinations of r elements in a given array

Aug 7 2015 10:36 AM
Hi Experts,
 
Add  all possible combinations of r elements in a given array of size n

Example: is input array     
int[] arr = new int[] { 1, 2, 3, 4, 5,6 };
output:  possible combination of arrary below:
1+4+5=10
2+3+5 =10
1+2+3+4=10
6+4=10
6+1+3=10

please help me

Thanks & Regards
Ashish Kumar Sahu 

Answers (1)