Friday, September 9, 2016

Balked: Permutations exercise

For the first time at FreeCodeCamp, I hit a clear limit: no. I am not trained for this kind of mathematical thinking. I feel angry and hazed that this is even in the course, as if we are all supposed to be math majors before we begin. I am a long time out of school. Recursive algorithms make me feel headachy and nauseous. I am fine doing research to locate a solution, but I cannot obey "write your own code" or even pretend I understood it. I can find a solution, and copy and paste. I can check the tests to be sure they pass. But no, I am not going to implement Heap's Algorithm in Javascript. Not this year.

I'm skipping this one.

No repeats please


Return the number of total permutations of the provided string that don't have repeated consecutive letters. Assume that all characters in the provided string are each unique.
For example, aab should return 2 because it has 6 total permutations (aab, aab, aba, aba, baa, baa), but only 2 of them (aba and aba) don't have the same letter (in this case a) repeating.
Remember to use Read-Search-Ask if you get stuck. Try to pair program. Write your own code.