As I understand it, your alphabet is 1 .. 10, and each "letter" can occur twice. So you really have an alphabet that ...
1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10
It has a length of 20, not 10.
Now the problem translates to 20. 4.
Hope this helps.
EDIT: According to your additional comments on your question, you can check each generated permutation to see if it has the form XXYY, as that would be incorrect according to what you wrote.
source
share