title: Traversing a 2D array matrix diagonally from bottom left to upper right
body: <p>I have a 3x4 matrix represented by a 2D array:</p>
  
  <pre><code>. 0  1  2  3
  0 a  c  f  i   
  1 b  e  h  k
  2 d  g  j  l
  </code></pre>
  
  <p>and my approach to traverse the diagonal slice was to treat each slice as a sum, like this:</p>
  
  <pre><code>a = (0+0) = 0
  b,c = (0+1),(1+0) = 1
  d,e,f = (0+2),(1+1),(2+0) = 2
  g,h,i = (1+2),(2+1),(3+0) = 3
  j, k = (2+2),(3+1) = 4
  l = (3+2) = 5
  </code></pre>
  
  <p>However, my code right now prints it in the opposite way that I want it to, which is from upper right to bottom left.</p>
  
  <p>Current Output is: </p>
  
  <pre><code>acbfedihgkjl
  </code></pre>
  
  <p>Desired Output is:</p>
  
  <pre><code>abcdefghijkl
  </code></pre>
  
  <hr>
  
  <pre><code>        for (int sum = 0; sum &lt;= numRows + numColumns - 2; sum++) {
              for (int i = 0; i &lt; numRows; i++) {
                  int j = sum - i;
  
                  if ((i &gt;= 0 &amp;&amp; i &lt; numRows) &amp;&amp; (j &gt;= 0 &amp;&amp; j &lt; numColumns)) {
                      System.out.print(array[i][j]);
                  }
              }
          }
  </code></pre>
  
  <hr>
  
  <p>Can somebody point me in the right direction on how to fix my code to get the output that I want?</p>