Problem 3097. Scrabble Scores - 12
This problem builds directly off of Scrabble Scores - 10. Here, you are provided an existing word on the board from which you will play a word. The letter can reside anywhere (first to last) within the existing word and within the word that you are playing. Write a function to find the highest scoring word, provided any letter from the existing word that 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 double-level cell array of strings containing all possible words based each starting letter in the existing word and the letters on your tray (a cell array for each letter in the existing word). (The word lists purposefully omit smaller words to prevent the test cases from being too large.) 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).
Previous problem: 11 - Word score optimization (known letter & multipliers). Next problem: 13 - Word score optimization (first word & multipliers).
Solution CommentsShow comments
Problem Recent Solvers18