c# - Combinations of strings of n lists -
i want build combinations of strings in multiple lists. have 3 parameters included. these "and"
, "or"
, "equal"
.
for example, have following 3 lists:
list 1: "india", "china", "iran"
list 2: "hindi", "english", "chinese"
list 3: "forest", "desert", "river"
the output should be
india or hindi or forest india , hindi , forest india equal hindi equal forest india or china or hindi india , china , hindi india equal china equal hindi iran or english or river iran , english , river iran equal english equal river
and on ...
the number of lists , number of strings in lists not fixed.
i'd prefer recursive solution.
i think you'll first need create combinations of words , last step apply each of keywords between them.
for each item in current list, if list last insert keywords, else recurse next list of words current.
Comments
Post a Comment