C#
0
Вклад в тег
List<List<double>> L123 = new List<List<double>> { new List<double>(), new List<double>(), new List<double>() };
new List<double>() { 1, 1, 2, 3, 5, 7, 9 }
.OrderByDescending(a => a)
.ToList()
.ForEach(b =>
{
L123
.ElementAt(L123
.Select((e, i) => new { e, i })
.Aggregate((f, s) => f.e.Sum() < s.e.Sum() ? f : s)
.i)
.Add(b);
});