Skip to content

Instantly share code, notes, and snippets.

@Fhernd
Created February 24, 2018 02:02
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 Fhernd/b8bfa8d7ed1149b68a5425680685d4a6 to your computer and use it in GitHub Desktop.
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.
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