Created
February 24, 2018 02:02
-
-
Save Fhernd/b8bfa8d7ed1149b68a5425680685d4a6 to your computer and use it in GitHub Desktop.
Encontrar el valor mínimo y máximo por índice en distintas sequencias.
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
List<int> secuencia1 = new List<int>(){3, 7, 11, 13, 19}; | |
List<int> secuencia2 = new List<int>(){2, 5, 3, 17, 11}; | |
// Valores mínimos: | |
secuencia1.Zip(secuencia2, (valorSecuencia1, valorSecuencia2) => | |
Math.Min(valorSecuencia1, valorSecuencia2) | |
).Dump("Valores Máximos"); | |
// Valores máximos: | |
secuencia1.Zip(secuencia2, (valorSecuencia1, valorSecuencia2) => | |
Math.Max(valorSecuencia1, valorSecuencia2) | |
).Dump("Valores Máximos"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment