hayden.mcparlane
BAN USERI noticed you mention the task is to return all possible strings in your post. However, do you actually mean that all possibilities should be printed? At first glance, what comes to mind when looking at this problem is frequency analysis. Keeping track of characters in the language and the frequency with which they occur. When one receives the scrambled string they could store all of the characters and their associated count in a dictionary. Using a list-like structure, they could then iterate from the least frequently used to the most frequently used characters in the language. If those characters are present in the string, the language dictionary can be referenced for words that start with or contain those infrequently used characters. Using this approach one can decrease the total number of words that need to be checked because those infrequently used characters will, obviously, be surrounded by additional characters that will be more frequent in the language eliminating the need to brute-force frequently used characters which would require analyzing huge numbers of words and combinations. To increase the probability of correctness, one could incorporate additional frequency tables such as one that indicates characters that start words, frequently used words (such as "the," "and,"), etc. Also, does grammatical correctness factor in here? If so, that can be further used to eliminate word combinations that don't make sense and, therefore, to further reduce the total complexity of the solution.
- hayden.mcparlane February 19, 2016testing submit
- hayden.mcparlane February 19, 2016
Sorry for duplicate message. The server took a couple of seconds to update and this is my first use of this site so I re-posted my message again. :-)
- hayden.mcparlane February 19, 2016