👩💻 Join our community of thousands of amazing developers!
1178. Number of Valid Words for Each Puzzle 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 in the puzzle). Return an array answer, where answer[i] is th...