Skip to content

Instantly share code, notes, and snippets.

@ssartell

ssartell/13.cs Secret

Created May 15, 2019 17:44
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/c8c85f04b6b53801f5905d50db399b9c to your computer and use it in GitHub Desktop.
Save ssartell/c8c85f04b6b53801f5905d50db399b9c to your computer and use it in GitHub Desktop.
/* LINQ Puzzle #13 *******************************************************
Summary: Given a sequence of integers (assume that no consecutive integers
are equal), determine all local maximums. Don't forget to include endpoints.
https://en.wikipedia.org/wiki/Maxima_and_minima
{1, 2, 1, 4, 3, 6} => {2, 4, 6}
{1, 0, 1, 5} => {1, 5}
{1, 2, 3, 4, 5, 6, 7} => {7}
{5, 4, 3, 2, 1} => {5}
************************************************************************/
var ints = new [] {1, 2, 1, 4, 3, 6};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment