No repeats please - Another point of view

No repeats please - Another point of view
0.0 0


Every algorithm (I didnt get trough them all) seems to lost the basic math problem (its more a math problem then coding one) so it tries to get through all permutations then test them for consecutive same characters. Some of them skip those with consecutive characters BUT only when they find them.
Try to let those algorithms with like “abcdefghijklmnopqrstuvwxyzz” and your computer is done (since theres 27! permutations thats 10 888 869 450 418 352 160 768 000 000 which u need to go through, store somewhere , then test, means u ve never get through, nor ur computer during ur lifespan)

But I still can solve this on my old computer in a matter of millisecond with this idea (and im currious noone had think about that, atleast as far as i got through this forums)

The consecutive zz can be perceived as one character (instead of two) so the solution is 27! - 2!*26! - could be done in a matter of secconds on a pocket calculator.
27! is permutations of 27 characters then we need to substract all permutations of 26 characters (zz is now one character) and since this is a permutations not combinations we need to multiple by all permutations of this one Doublecharacter (imagine this as z1z2 then z2z1)

In case, there more of multiplied characters (like in the chalenge abcdefaf) there u need to ad the ones substracted multiple times (same order), in this case twice. So 7! - 2!*6! - 2!*6! + 2!*5! + 2!*5!

I think a good coder should invest more in problem analysis so he can save lots of time, lots of code written, maybe some lives (life of a computer in this case literally)