If I have a list of words in the variable words and a list of letters in the variable letters, how can I find all the words that can be made up out of the letters in letters. Any subset of the letters in the variable letters can be used and letters can be used more than once. I would like to do this in Python.
For example:
letters = ['a', 'b', 'i', 'l', 'r', 's', 't', 'u']
words = ['dummy', 'australia']
Should return:
'australia'
even though there is an additional 'b', but not:
'dummy'
since d, m and y are not available.