title: Get index of sorted matrix
body: <p>Suppose i enter a matrix and sort her rows, for example:</p>
  
  <p>(3 5 1 4</p>
  
  <p>4 3 7 2</p>
  
  <p>1 0 9 7)</p>
  
  <p>then sort the matrix :</p>
  
  <p>(1 3 4 5</p>
  
  <p>2 3 4 7</p>
  
  <p>0 1 7 9)</p>
  
  <p>i want show the index matrix after sorting the matrix</p>
  
  <p>(2 0 3 1</p>
  
  <p>3 1 0 2</p>
  
  <p>1 0 3 2)</p>
  
  <p>i use this code to sort the mattrix :</p>
  
  <pre><code>public static void sortRows(int[][] matrix){        
      for (int i = 0; i &lt; matrix.length; i++) {            
          Arrays.sort(matrix[i]);
       }
  }
  </code></pre>
  
  <p>The problem is: how can I find the maatrix of newIndex from the input matrix?</p>
  
  <p>Thanks in advance</p>