I'm doing a text twist program, and I'm having a problem checking whether a word can be created out of the given group of letters. It's very easy if there are no repeating letters, but how do I do it if a user inputs a word which has repeating letters? I used tuple but it does not work if the letters repeat.
To make it clearer, I'm providing this example:
Say your group of letters is (d,n,a,e,l,i)
and the user inputs the word need
. We can see that the letter e
was used here twice, but since the code (using tuple) that I made just checks if a list is a subset of a list, it counts need
as a correct answer when it is not. How do I fix it?