max_score
to keep track of the maximum score found.letter_count
from the list of letters.backtrack
that takes the current index i
and the current score current_score
.i
is beyond the last index, update max_score
with the maximum of max_score
and current_score
.i
to the end.letter_count
.letter_count
, add the word's score to current_score
, and recursively call backtrack
with the next index and the updated score.letter_count
(backtrack).max_score
after exploring all combinations.