I have this piece of software where the user enters a sequence of letters (doesn't matter which ones and there can be repeats). I then get all permutations of all lengths without repetition (e.g. "tee" -> "e", "t", "ee", "et", "te", "eet", "ete", "tee"), which I've done.
Now I need to count how many of them there are before I actually permute them all (e.g. "tee" -> 8). Without repeated letters, I would have (1! x 2! x 3! x …); but repeated letters complicates things. How would I go about solving this?