Given 2d matrix find minimum sum of elements such that element is chosen one from each row and column?
<p>Find minimum sum of elements of n*n 2D matrix such that I have to choose one and only one element from each row and column ?
Eg </p>

<pre><code>4  12 

6  6
</code></pre>

<p>If I choose <code>4</code> from row <code>1</code> I cannot choose <code>12</code> from row <code>1</code>  also from column <code>1</code> ,
I can only choose 6 from row 2 column 2.</p>

<p>So likewise minimum sum would be <code>4 + 6 = 10</code> where <code>6</code> is from second row second column </p>

<p>and not <code>6 + 12 = 18</code> where <code>6</code> is from second row first column</p>

<p>also <code>4 + 12</code> is not allowed since both are from same row</p>

<p>I thought of brute force where once i pick element from row and column I cannot pick another but this approach is <code>O(n!)</code>
.</p>