title: Print Elements of Row and column wise sorted matrix in sorted order
body: <p>I am trying to print the below matrix in sorted order, but can't seem to think about any optimal solution. Can you please help?</p>
  
  <pre><code>1 2 3 4
  2 3 4 5
  4 7 8 9
  5 6 9 10
  </code></pre>