Easy · Strings
Find all subset words
Given an ASCII-letter string text and a list of ASCII-letter words, return (in any order) every word that can be spelled from text's letters, using each letter at most as many times as it occurs in text; each word is checked on its own against all of text.
Examples
Example 1
text="codebase" · 5 wordsOutput: [code, base, cab, ace, bad]
Example 2
text="aabbc" · 3 wordsOutput: [abc, aab]
Rebuild it in the studio
Open every published interview problem, solution, scene, and memory room free, with no account.