9
Answers

Split an array like below.

Pruthvi Patel

Pruthvi Patel

8y
387
1
arr[]={1,2,3,4,5,6,6,7,6,5,4,3,7,8,8,8,4,3,2,8....n}
split=2  
sum=2
then the result array should be like this.
res[0]=47     //1+2+5+6+6+5+7+8+4+3 
res[1]=53    //3+4+6+7+4+3+8+8+2+8 
Please help me to do this. 

Answers (9)