← All problemsSign in

1178. Number of Valid Words for Each Puzzle

LeetCodeArrayHash TableStringBit ManipulationTrieOpen on judge ↗

With respect to a given puzzle string, a word is valid if both the following conditions are satisfied: - word contains the first letter of puzzle. - For each letter in word, that letter is in puzzle. - For example, if the puzzle is "abcdefg", then valid words are "faced", "cabbage", and "baggage", while - invalid words are "beefed" (does not include 'a') and "based" (includes 's' which is not

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start