var query = data.Select((x, r) =>x.Select((v, c) => new { r, c, v }));
var result = query.GroupBy(x => x.c).Select(x => x.Select(y => y.v).OrderBy(x => x.r).ToArray()).ToArray();
我的代碼?
var query = data.Select((x, r) =>x.Select((v, c) => new { r, c, v }));
寫錯了,是
var query = data.SelectMany((x, r) =>x.Select((v, c) => new { r, c, v }));