-
-
Save ssartell/c8c85f04b6b53801f5905d50db399b9c 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 #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