Amazon | Phone Screen | Scrabble Max Score Words
2805

Given n characters (might be repeating), find set of words with maximum score given a dictionary of valid words and a score of every character. It is not necessary to use all characters while forming the words (sentence of words)

Example:

Input:
scores = a-1, b-2, c-2, d-4, e-1
tiles = [c, a, a, b, e, d, d, a]
dictionary = ["cab", "bed", "dead", "be", "dad" ]

Output: ["cab", "dead"]
Explanation: since both cab and dead are valid words and their combined score is maximum compared to any other selection of words.
Other possible outputs are like ["bad"] or ["dad" , "cab"] but they have a lower total score.

In other words, we have to find the maximum scoring valid word sentence possible using the characters given.

[UPDATE]: This question has been now posted as official leetcode hard problem - https://leetcode.com/problems/maximum-score-words-formed-by-letters/

Comments (13)