Question: For example this matrix:

```
3 2
2 2
1 2

```

Writed as this:

```
IEnumerable<IEnumerable<int>> inputRows = ...;

```

Must become:

```
1 2
2 2
2 3

```

So, all biggest numbers will be concentrated in the down right corner.
First, I need to sort **column numbers** (not entire columns), which is pretty easy to do:

```
var result = inputRows.Select(x=> x.OrderBy(y=>y));

```

After this step matrix will become:

```
2 3
2 2
1 2

```

But how do I sort out entire rows with LINQ? 

**PS** Im not interested in fixed arrays solutions.

Answer: 
You will need a row comparer. We'll keep in mind that all rows have same length:

```
public class RowComparer : IComparer<IEnumerable<int>>
{
    public int Compare(IEnumerable<int> x, IEnumerable<int> y)
    {
        // TODO: throw ArgumentNullException 
        return x.Zip(y, (xItem, yItem) => xItem.CompareTo(yItem))
                .Where(c => c != 0).FirstOrDefault();
    }
}

```

And use it for sorting:

```
inputRows.Select(r => r.OrderBy(x => x)).OrderBy(r => r, new RowComparer())

```

Output for your sample:

```
[
  [ 1, 2 ],
  [ 2, 2 ],
  [ 2, 3 ]
]

```
Maybe this?

```
var result = inputRows.Select(row => row.OrderBy(col => col)).OrderBy(row => row.Sum());

```

It's not clear how do you want order rows: by the whole row or by each cell?