Advertisement
Fhernd

MinMaxBids.cs

Jul 13th, 2016
819
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.40 KB | None | 0 0
  1. // Sequences of bid values:
  2. List<int> bidValues1 = new List<int>() { 1, 2, 3, 4, 5 };
  3. List<int> bidValues2 = new List<int>() { 5, 3, 4, 1, 2 };
  4.  
  5. // Find the maximum bids:
  6. bidValues1.Zip(bidValues2, (bid1, bid2) =>
  7.     Math.Max(bid1, bid2))
  8.     .Dump("Maximum Bids");
  9.  
  10. // Find the minumum bids:
  11. bidValues1.Zip(bidValues2, (bid1, bid2) =>
  12.     Math.Min(bid1, bid2))
  13.     .Dump("Minimum Bids");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement