I have a Dictionary<string, HashSet<string>>
that I would like to go through and find all the combinations in the HashSet possible without any repeats. For example (dummy data):
Keys Values (HashSet)
"greeting" "Hello" "Hi" "Hey" "Howdy" ...
"Name" "Tom" "Angel" "Edward" ...
"question" "how are you?" "can you help me?" "is everything okay?" ...
... ...
... ....
I would like the output to be some sort of collection with each value as:
"Hello Tom how are you?"
"Hello Tom can you help me?"
"Hello Tom is everything okay?"
"Hello Angel how are you?"
"Hello Angel can you help me?"
"Hello Angel is everything okay?"
"Hello Edward how are you?"
...
"Hi Tom how are you?"
"Hi Tom can you help me?"
"Hi Tom is everything okay?"
"Hi Angel how are you?"
...
I would like to have this as abstract as possible to where I can add as many keys and values in the hashset as I want.
I have tried to do it recursively but I am not too strong with that and I cannot come up with a base case... I think you can do this with linq but I am not familiar with linq at all.
The reason I am using a Dictionary<string, HashSet<string>>
is because of how I am gathering the information so I would like to keep this data structure.
Thank you!