This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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