Skip to content

Instantly share code, notes, and snippets.

@ssartell

ssartell/1.cs Secret

Created July 11, 2016 18:21
Show Gist options
  • Select an option

  • Save ssartell/6b34a36a235490ca21d275e30b336f0a to your computer and use it in GitHub Desktop.

Select an option

Save ssartell/6b34a36a235490ca21d275e30b336f0a to your computer and use it in GitHub Desktop.
/* LINQ Puzzle #1 *******************************************************
Summary: Given a collection of integers, create a new collection containing the difference between each consecutive element in the collection.
Sample Input: {4, 3 ,6, 8, 2}
Sample Output: {1, -3, -2, 6}
************************************************************************/
// Given:
var rand = new Random();
var values = Enumerable.Repeat(0, 100).Select(x => rand.Next(0, 100)).ToList();
// Your solution goes here:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment