Created
February 6, 2014 12:56
-
-
Save tugberkugurlu/8843641 to your computer and use it in GitHub Desktop.
Find possible variations of one item out of multiple baskets. ref: http://programmers.stackexchange.com/questions/227908/find-possible-variations-of-one-item-out-of-multiple-baskets
This file contains hidden or 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
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
IEnumerable<string> basket1 = new List<string> { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10" }; | |
IEnumerable<string> basket2 = new List<string> { "11", "12", "13", "14", "15", "16", "17", "18", "19", "20" }; | |
IEnumerable<string> basket3 = new List<string> { "21", "22", "23", "24", "25", "6", "7", "8", "9", "30" }; | |
foreach (var item1 in basket1) | |
foreach (var item2 in basket2) | |
foreach (var item3 in basket3) | |
{ | |
Console.WriteLine("{0}, {1}, {2}", item1, item2, item3); | |
} | |
Console.ReadLine(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment