I have a dictionary like this.
Dictionary<int, string> Diccionario = new Dictionary<int, string>(){
{1,"124"} , {4,"1457"} , {7,"478"},
{2,"1235"} , {5,"24568"} , {8,"05789"},
{3,"236"} , {6,"3569"} , {9,"698"},
{0,"08"}
};
And I'd like to get all combinations for n
integer. For example.
for n = 11
- 11, 12, 14, 21, 22, 24, 41, 42, 44.
for n = 24
- 11, 14, 15, 17, 21, 24, 25, 27, 31, 34, 35, 37, 51, 54, 55, 57.
for n = 339
- 236, 256, 259...
And so on... But I don't have ANY IDEA how I could iterate through all of those numbers, since the lenght of every number isn't always the same. (1 has three possible combinations, 2 has four; and so on)
Thanks!
Since you guys asked me where does the data come from... It comes from here.
Imagine the PIN is 1273
, then it's necessary to create all possible combinations based on the adjacent digit (horizontally and vertically) for example (1 has 2, 3 and the number itself), to make it easier I made the dictionary that can be seen earlier, giving each key its possible value.
Since the answer was closed, I'm not sure what kind of info more I could add, because I can't say too much about the problem. It's like if I had a dictionary of colors, for example:
Dictionary<int, string> Diccionario = new Dictionary<int, string[]>(){
{1,{"red"}, {"blue"}, {"green"}} ,
{2,{{"green"}, {"orange"} },
{3, {{"dark"}}
};
So if I got the number 32 combinations would be: Dark Green
or Dark Orange
Not sure If I'm ilustring my point.