No repeats... no chance

No repeats... no chance


I’m going to skip this challenge for 2 reasons

  1. the help provided is not help. It’s just not explained.

  2. The solution doesn’t have any factorial calculations as recommended in the test

If this means I don’t get a certificate at the end of my studies, so be it.


I also skipped this. I found it too hard for me for now.

The good news is that this challenge is optional; you don’t have to complete this to get the cert :slight_smile:


I am honest enough to say that I understand the problem but I don’t have a clue where to start.
The supplied answer did not help as I mentioned, because there is little explanation of the code.
Look at the comments here:
// Generate arrays of permutations using the algorithm. function generate(int) { if (int === 1) { // Make sure to join the characters as we create the permutation arrays permutations.push(arr.join('')); } else { for (var i = 0; i != int; ++i) { generate(int - 1); swap(int % 2 ? 0 : i, int - 1); } } }
It’s a recursive function but I have no clue what swap is doing. Some immediate if statement would be my guess.
Also putting random inputs in, unless your calcs are correct, you have no idea if you are correct or not.

So on balance, I would rather move onto learning something I might use in industry instead of scratching my head for days.