-
-
Save ssartell/fc89d0110cee5a2fa2fd to your computer and use it in GitHub Desktop.
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 #11 ******************************************************* | |
Summary: Given a sequence of integers, determine if the sequence is strictly monotonic | |
(increasing or decreasing). That just means that the sequence is either always increasing | |
or always decreasing and no consecutive numbers can be the same. | |
https://en.wikipedia.org/wiki/Monotonic_function | |
{1, 2, 3, 4, 5} => true | |
{-1, -2, -4, -100, -101} => true | |
{1, 3, 5, 0, 6} => false | |
{1, 2, 2, 3} => false | |
************************************************************************/ | |
void Main() | |
{ | |
var sequence = new List<int>() { 1, 2, 3, 4, 5 }; | |
// your code here | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment