To solve, use the multiplication principle. Have a set of lists, A = {a1, a2, a3, ..., an}. k-permutations will result in picking letters from source string and moving to next element, chosing from remainder. If all of the slots were unique:
s <- 'MISSISSIPPI'
n <- len(nchar(s))