7 kyu

Lorraine Wants to Win the TV Contest

500 of 827raulbc777

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).

Fundamentals
Algorithms
Data Structures

Stats:

CreatedOct 26, 2015
PublishedNov 5, 2015
Warriors Trained1791
Total Skips60
Total Code Submissions4079
Total Times Completed827
Python Completions500
Ruby Completions117
JavaScript Completions245
Total Stars28
% of votes with a positive feedback rating88% of 177
Total "Very Satisfied" Votes141
Total "Somewhat Satisfied" Votes30
Total "Not Satisfied" Votes6
Ad
Contributors
  • raulbc777 Avatar
  • NaMe613 Avatar
  • B1ts Avatar
  • FArekkusu Avatar
  • hobovsky Avatar
  • Just4FunCoder Avatar
  • saudiGuy Avatar
Ad