GroupJoin

CSharp · Console

/Program.cs

using System;
using System.Linq;
using System.Collections.Generic;
					
public class Program
{
	public static void Main()
	{
		var x = new int[] { 2, 4, 6, 8, 10 };

        var y = Enumerable
          .Range(0, 2)
		  .GroupJoin(x, a => a, b => b % 2, (key, items) => (key : key, list : items.ToList()))
          .ToList();
		
		Console.WriteLine(string.Join(Environment.NewLine, y.Select(pair => $"{pair.key} : {string.Join(", ", pair.list)}")));
	}
}
;