Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Head breaker
Message
From
03/07/2019 05:16:58
 
 
To
02/07/2019 19:55:10
General information
Forum:
C#
Category:
Coding, syntax and commands
Title:
Miscellaneous
Thread ID:
01669346
Message ID:
01669357
Views:
46
>>>I'm trying to write code that will generate valid English words from an array of seven letters.
>>>string[] letters = new string[] { "g", "a", "u", "n", "t", "l", "e", "t' };
>>>
>>>I found a dictionary that gives valid results when testing to see if a word is valid.
>>>(See checkit, below)
>>
>>Each letter can only be used once?
>>
>You can use a letter more than once.
>

Hmmm,
intent still not clear, as example already includes "t" twice. You can speed up performance of the permutation generation by pruning the source letter array to have only discrete entries - unless you do, "ttttttt" will be in result list several times, as well as more than 1 entry for every result including at least 1 "t".

"dean" will get you all the *discrete* results "deadended" could evoke in less time if the repeating permutation is your goal ;-)
Previous
Reply
Map
View

Click here to load this message in the networking platform