Skip to content

Instantly share code, notes, and snippets.

@ssartell

ssartell/4.cs Secret

Created July 11, 2016 21:34
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/6314ddf2e8d3c6a120e89b24063216ae to your computer and use it in GitHub Desktop.
Save ssartell/6314ddf2e8d3c6a120e89b24063216ae to your computer and use it in GitHub Desktop.
/* LINQ Puzzle #4 *******************************************************
Description: Given a collection of objects and an integer n, cluster every n objects together.
Sample Input: {0, 0, 0, 0, 0, 0, 0}; n = 3;
Sample Output: {{0, 0, 0}, {0, 0, 0}, {0}}
************************************************************************/
// Given:
var input = Enumerable.Repeat(0, 15).ToList();
var n = 5;
// Your solution goes here:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment