Skip to content

Instantly share code, notes, and snippets.

@ssartell
Created July 10, 2015 15:42
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/fc89d0110cee5a2fa2fd to your computer and use it in GitHub Desktop.
Save ssartell/fc89d0110cee5a2fa2fd to your computer and use it in GitHub Desktop.
/* 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