Input: words = {"dog", "cat", "dad", "good"}, letters = {"a", "a", "c", "d", "d", "d", "g", "o", "o"}, score = {1, 0, 9, 5, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
Output: 23
Explanation:
The scores of 'a', 'c', 'd', 'g', and 'o' are 9, 5, 3, 2 respectively.
The score of the word "dad" = (5 + 1 + 5) = 11.
The score of the word "good" = (3 + 2 + 2 + 5) = 12.
Therefore, the total score = 11 + 12 = 23, which is maximum.
Input: words = {"xxxz", "ax", "bx", "cx"}, letters = {"z", "a", "b", "c", "x", "x", "x"}, score = {4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 10}
Output: 27