title: Split array based on sum of the values of each element
body: <p>Suppose the elements of an input array are arranged in ascending order, as in this sample:</p>
  
  <pre><code>int[] a= {23,24,25,30,34,36,40,41,43,45,50};
  </code></pre>
  
  <p>I need to split the array into different sub-arrays. Each sub-array will contain elements such that their sum will be less than or equal to 100.</p>
  
  <p>For the above input, my output should be:</p>
  
  <pre><code>b1[]= {23,24,25};
  
  b2[]= {30,34,36};
  
  b3[]= {40,41};
  
  b4[]= {43,45};
  
  b5[]= {50};
  </code></pre>
  
  <p>The value and number of elements in the input array may vary.</p>
  
  <p>I am very new to Java, and I am completely stuck. Please suggest a way for me to proceed.</p>