I have a list of int in c#, I want to group them in unique elements.
List<int> items = new List<int>() { 1, 3, 1, 2 };
As you can see it's have 4 element 1,3,1,2. I want to group them in size of 2. for example
[1,3],[1,2]
[1,1],[3,2]
As you can see, it's make these unique group. I am not sure how to achieve this in C#. In this case I need to group by 2, but maybe I need to group by any other number (N).
The list may contains more item than 4.