Skip to content

Instantly share code, notes, and snippets.

@smoak
Created October 14, 2011 23:21
Show Gist options
  • Save smoak/1288663 to your computer and use it in GitHub Desktop.
Save smoak/1288663 to your computer and use it in GitHub Desktop.
var orders = new [] { 1, 5, 7, 42 };
var customers = new [] { 1, 2, 3, 4, 5, 6, 7, 42 };
var customersWithOrdersCount = 0;
foreach (var c in customers) {
foreach (var o in orders) {
if (c == o) {
customersWithOrdersCount++;
break;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment