HARDasked at 1 company

Maximum Score Words Formed by Letters

A hard-tier problem at 82% community acceptance, tagged with Array, String, Dynamic Programming. Reported in interviews at Infosys and 0 others.

Founder's read

You've got a list of words and a pile of letters with scores attached. Your job: pick words from that list so you can form them using only your available letters, then maximize the total score. The catch is you can only use each letter once. It's not about longest or most words, it's about which combination of valid words gets you the highest score. Infosys has asked this one. The acceptance rate is high, which usually means the pattern is learnable if you see it once. If you hit this live and freeze on the state-space search, StealthCoder surfaces a working solution in seconds, invisible to the proctor.

Companies asking
1
Difficulty
HARD
Acceptance
82%

Companies that ask "Maximum Score Words Formed by Letters"

If this hits your live OA

Maximum Score Words Formed by Letters is the kind of problem that decides whether you pass. StealthCoder reads the problem on screen and surfaces a working solution in under 2 seconds. Invisible to screen share. The proctor sees nothing. Built by an Amazon engineer who used it to pass JPMorgan's OA and system design loop.

Get StealthCoder
What this means

The trick here is recognizing this as a constrained optimization problem where you need to explore combinations of words without exceeding your letter budget. Backtracking with bitmask representation is the standard move: for each word, check if you can form it given your remaining letters, then recursively try adding that word or skipping it. The bitmask tracks which letters you've used. Most people either try greedy (pick highest-scoring words first, fails) or brute-force all subsets without pruning (too slow). The real pattern is pruning aggressively: validate letter availability early, use memoization on the letter state, and recognize that bit manipulation lets you compress the letter counts into a fast comparison. Common pitfall is implementing the letter-count check inefficiently or forgetting that you need to track what letters are left after each word selection. Backtracking plus careful state management is the hedge.

Pattern tags

The honest play

You know the problem. Make sure you actually pass it.

Maximum Score Words Formed by Letters recycles across companies for a reason. It's hard-tier, and most candidates blank under the timer. StealthCoder is the hedge: an AI overlay invisible during screen share. It reads the problem and surfaces a working solution in under 2 seconds. Built by an Amazon engineer who used it to pass JPMorgan's OA and system design loop. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Maximum Score Words Formed by Letters interview FAQ

Is this a greedy problem or do I need to explore multiple branches?+

You need to explore multiple branches. Greedy fails because a low-scoring word might unblock higher-scoring words later. Backtracking with pruning is standard. Try each word, recurse, backtrack if it doesn't help. The high acceptance rate reflects that the pattern is clear once you recognize it.

How do I check if a word can be formed from my remaining letters?+

Count the frequency of each letter in the word and compare it to your available letter counts. If any letter in the word exceeds what you have left, you can't use it. Do this check before recursing to prune early branches.

What's the role of bitmask in this problem?+

Bitmask can represent which letters you've already selected or used up. It's useful for memoization: store results indexed by the bitmask state of remaining letters. This avoids recalculating the same subproblem. It's an optimization, not mandatory, but makes the solution faster.

Should I use recursion or dynamic programming?+

Backtracking (recursion with pruning) is more natural here because you're building up a set of selected words step by step. DP is possible if you memoize by letter state, but backtracking is clearer and performs well on typical input sizes.

Why is the acceptance rate so high if this is marked hard?+

Once you spot that it's a constrained search problem solvable by backtracking, the implementation is straightforward. Most candidates who study backtracking patterns will recognize the shape. The 'hard' label reflects the algorithmic category, not the execution bar. Infosys is the only company listed; this isn't a FAANG staple, so less saturation.

Want the actual problem statement? View "Maximum Score Words Formed by Letters" on LeetCode →

Frequency and company-tag data sourced from public community-maintained interview-report repos. Problem, description, and trademark © LeetCode. StealthCoder is not affiliated with LeetCode.