How many distinct strings of length 4 can be generated with $c,b,b,a,a,d$
Through a script I know that there are 102 such possibilities.
My Attempt
Case 1: using only one 'b' and one 'a'. This can happen in 4! number of strings.
Case 2: using two 'a' and no 'b'. 12
Case 3: using two 'b' and no 'a'. 12
Case 4: Using two 'a' and one 'b'. 12*2
Case 5: Using two 'b' and one 'a'. 12*2
Case 6: Using two 'a' and two 'b' only. 6
Adding numbers from all the cases I get 102 which actually complies with the script findings.
Question
Is there any better way to do this, a formula?