Skip to content

Instantly share code, notes, and snippets.

@ssartell

ssartell/1.cs Secret

Created July 11, 2016 18:21
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
/* 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