Lorraine Wants to Win the TV Contest
Description:
There are many word games that can help to make our minds more agile. Many TV programs, in different countries, use them as entertainment for the audience.
Lorraine had tried to win one of them many times but she was not successful in her attempts. The TV contest is as follows:
The TV show host gives a random caller a scrambled word (that is incomprehensible) and by rearranging those letters they have to discover a word that is in the Oxford English Dictionary.
They have only 25 seconds to discover the word.
Her friend Bruce obtained the list of 2000, frequently used, English words used by the TV show.
Help Lorraine by making a function that will give her a list of all valid words that may be obtained by rearranging the scrambled word. There always be at least one valid word for each test case.
Let's see some test cases:
unscramble("shi") == ['his']
unscramble("nowk") == ['know']
unscramble("amle") == ['male', 'meal']
The list of words that Bruce obtained (keep the secret!) is named word_list
, in ruby $word_list
and javascript wordList
.
For words with more than six letters we have a challenge with speed.
Try to create a suitable memoized data structure for fast hashing using the provided word_list
.
Remember that all the words will correspond to U.K. English (Oxford Dictionary).
Similar Kata:
Stats:
Created | Oct 26, 2015 |
Published | Nov 5, 2015 |
Warriors Trained | 1791 |
Total Skips | 60 |
Total Code Submissions | 4079 |
Total Times Completed | 827 |
Python Completions | 500 |
Ruby Completions | 117 |
JavaScript Completions | 245 |
Total Stars | 28 |
% of votes with a positive feedback rating | 88% of 177 |
Total "Very Satisfied" Votes | 141 |
Total "Somewhat Satisfied" Votes | 30 |
Total "Not Satisfied" Votes | 6 |