Problem 3098. Scrabble Scores - 13

Created by goc3 in Community

This problem integrates components of Scrabble Scores - 11 and Scrabble Scores - 12. 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. In addition, multipliers from the board are provided. Write a function to find the highest scoring word, provided any letter from the existing word that you are building off of, the letters on your tray, and the multipliers (provided in specific locations; see below).

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

You will be provided a multiplier character array that represents the fifteen possible squares that can be played on for each letter in the existing word, ranging from seven above each existing letter (in which case the existing letter is the last letter in an eight-letter word) to seven below each existing letter (in which case the existing letter is the first letter in an eight-letter word) with the existing letter fixed in the 8th (column) position. The array will have the same number of rows as the length of the existing word (which is located along the middle of the array). The multipliers are the same as in previous problems:

 * D: double word
 * T: triple word
 * Q: quadruple word
 * d: double letter
 * t: triple letter
 * q: quadruple letter

The center multiplier square will be left blank, since it's already covered by a tile.

Related problems:

Previous problem: 12 - Word score optimization (first word).

Solution Stats

73.33% Correct | 26.67% Incorrect
Last solution submitted on Jan 04, 2019

Problem Comments