Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 1178. Number of Valid Words for Each Puzzle
For each 7-letter puzzle, count how many words consist only of letters from that puzzle and also include the puzzle's first letter. Key observation: encode words and puzzles as bitmasks, precompute word-mask frequencies, and for each puzzle enumerate subsets of its other 6 letters (2^6) that include the first letter to sum valid words efficiently.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.