No Repeats Problems gives different results,kindly guide

Hi,

So i am trying to find a solution to no repeats , i read and found if there are no repeat character then the formulae is permutation of n things taken n at a time, and the formulae is -

n!/n! - r! , so if i were to take abcdefa at a time , it would mean 7!/7! - 2! but the result does not match FCC results …

Or is it 7!/2! where 2 is the number of times a is repeated ?

Or do i need to find all permutation like 7! = 5040 and subtract it with something

Then i looked for solution and came across stackoverflow and youtube videos but got even more confused , can any one who has done this kindly explain what i need to do …Thanks

Ok , i think i get it but please tell me if i am thinking right or just making things up myself :confused:

1)The task says take each character unique so , i take total value as 7! = 5040

2)then i take both a as unique and bundle them together and say all values with them side by side by side needs to be subtracted so i take 6! = 720

3)Then as the other a is unique i take it as another set and switch positions then again take 6! = 720 , add both then subtract from 5040 that is 3600 …

My confusion can i really take both are “aa” and reduce length to 6 and how does that work logically ?

Regards