title: Take user input into a matrix of unknown size until -1 is entered
body: <p>So I need to read in an integer matrix from standard input from the user. The matrix will be specified with spaces between the columns and with each row on a new line. The input is terminated with a -1.</p>
  <p><strong>Input</strong></p>
  <pre><code>3 9 7 1
  2 4 8 6
  3 7 9 2
  -1
  </code></pre>
  <p>I know that 2D arrays cannot be used since the dimension of the matrix is unknown. I've read up about 2d arraylists but I'm unsure on how to store or read that info from the user.</p>
  <p>Any help is appreciated thanks</p>