Q:

Permuting "123456728905"

In how many ways can 123456728905be permuted such that, neither two 2's nor two 5's are adjacent to each other ? 
I'm really confused how to ensure those conditions?
0 is allowed to come as the first. Consider these are simple characters, not as a whole number.
Can someone help me ?

A:

Hint: Calculate the number of ways in which the two $2's$ and the two $5's$ are always adjacent to each other. Subtract this from the total possible permutations.
Total possible permutations: $\frac{12!}{2!*2!}$
Now group the two $2's$ together and the two $5's$ together. So you have a total of $10$ strings now in place of $12$. So total possible permutations: $10!$
Required permutations would then be: $\frac{12!}{2!*2!} - 10!$

