startSet.startWords, sort the characters and add the sorted string to startSet.count to 0 to keep track of the number of valid targetWords.targetWords, sort the characters.targetWord, remove the character and check if the resulting string is in startSet.count and break out of the loop to avoid double-counting.count.