Skip to content

Instantly share code, notes, and snippets.

@ssartell

ssartell/6.cs Secret

Created May 24, 2018 20:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ssartell/e73aa44aba249c94561a75b80e6e3697 to your computer and use it in GitHub Desktop.
Save ssartell/e73aa44aba249c94561a75b80e6e3697 to your computer and use it in GitHub Desktop.
/* LINQ Puzzle #6 *******************************************************
Description: Given a collection of objects and an integer n, create n clusters of objects. The size of each cluster should vary by no more than 1.
Sample Input: {0, 0, 0, 0, 0, 0, 0, 0, 0}; n = 4;
Sample Output: {{0, 0, 0}, {0, 0}, {0, 0}, {0, 0}};
************************************************************************/
// Given:
var values = Enumerable.Range(0, 7).ToList();
var n = 4;
// Your solution goes here:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment