Problem 3082. Scrabble Scores - 10
This problem is very similar to the previous problem. Here, you are provided a letter of an existing word on the board from which you will play a word. The letter can reside anywhere (first to last) within the word you are playing. Write a function to find the highest scoring word, provided the letter you are building off of and the letters on your tray.
Rather than having to test all the possible permutations against a dictionary, you will be provided a cell array of strings containing all possible words based on the starting letter and the letters on your tray. In addition to providing the highest score, also provide the word(s) that achieve that score in a cell array. See the test suite for examples. Due to high-scoring tiles, the highest score may not be achieved by the longest word(s).
Related problems:
Previous problem: 9 - Word score optimization (fixed first letter). Next problem: 11 - Word score optimization (known letter) & multipliers.
Solution Stats
Problem Comments
-
7 Comments
Grant, Your dictionary is ok. I was trying to say the same thing as Alfonso, but I did it in "hard to read" way. At first I thought that there are some words on the list that have more points than max_score but doesn't have required letter inside.
"11th" was great, waiting for "Scrabble Scores - 12"! :-D My mother tongue is Polish, but I have also magnetic version of pocket Scrabble in English!
I'll get to the next problem soon. Now, I understand your comments. Incidentally, for almost all of the test cases, the existing letter made it through to the highest-scoring word. I have updated the test suite so that the existing letter is now accounted for. Thanks for the catch.
Solution Comments
Show commentsProblem Recent Solvers24
Suggested Problems
-
Replace NaNs with the number that appears to its left in the row.
3012 Solvers
-
296 Solvers
-
205 Solvers
-
construct matrix with identical rows
199 Solvers
-
50 Solvers
More from this Author139
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!