title: Create arrays dynamically from console input
body: <p>I have a problem where I need to create arrays from the console input strong. Expected input will be comma separated values. However, there will be new line characters as well which will indicate to create a new array and insert remaining values in a new array till next new line character. Below is an example</p>
  
  <pre><code>1,23,65,4,29
  8,80,5
  6
  2,20,17
  </code></pre>
  
  <p>For above example, code should create 4 array. Similarly for </p>
  
  <pre><code>1,2,3
  4
  </code></pre>
  
  <p>The code should create 2 arrays and so on.
  I am struggling to create dynamic number of arrays in the fly. I used scanner to read input and create array using , as separator</p>