<p dir="auto">Challenge <a href="https://www.freecodecamp.com/challenges/make-dead-links-using-the-hash-symbol" rel="nofollow">Make Dead Links using the Hash Symbol</a> has an issue.<br>
User Agent is: <code class="notranslate">Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36</code>.<br>
Please describe how to reproduce this issue, and include links to screenshots if possible.</p>
<p dir="auto">My code:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="
&lt;link href=&quot;https://fonts.googleapis.com/css?family=Lobster&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;&gt;
&lt;style&gt;
  .red-text {
    color: red;
  }

  h2 {
    font-family: Lobster, Monospace;
  }

  p {
    font-size: 16px;
    font-family: Monospace;
  }

  .thick-green-border {
    border-color: green;
    border-width: 10px;
    border-style: solid;
    border-radius: 50%;
  }

  .smaller-image {
    width: 100px;
  }
&lt;/style&gt;

&lt;h2 class=&quot;red-text&quot;&gt;CatPhotoApp&lt;/h2&gt;

&lt;p&gt;Click here for &lt;a href=&quot;#&quot;&gt;cat photos&lt;/a&gt;.&lt;/p&gt;

&lt;img class=&quot;smaller-image thick-green-border&quot; src=&quot;https://bit.ly/fcc-relaxing-cat&quot; alt=&quot;A cute orange cat lying on its back. &quot;&gt;

&lt;p class=&quot;red-text&quot;&gt;Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.&lt;/p&gt;
&lt;p class=&quot;red-text&quot;&gt;Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.&lt;/p&gt;
"><pre class="notranslate"><code class="notranslate">
&lt;link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css"&gt;
&lt;style&gt;
  .red-text {
    color: red;
  }

  h2 {
    font-family: Lobster, Monospace;
  }

  p {
    font-size: 16px;
    font-family: Monospace;
  }

  .thick-green-border {
    border-color: green;
    border-width: 10px;
    border-style: solid;
    border-radius: 50%;
  }

  .smaller-image {
    width: 100px;
  }
&lt;/style&gt;

&lt;h2 class="red-text"&gt;CatPhotoApp&lt;/h2&gt;

&lt;p&gt;Click here for &lt;a href="#"&gt;cat photos&lt;/a&gt;.&lt;/p&gt;

&lt;img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back. "&gt;

&lt;p class="red-text"&gt;Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.&lt;/p&gt;
&lt;p class="red-text"&gt;Purr jump eat the grass rip the couch scratched sunbathe, shed everywhere rip the couch sleep in the sink fluffy fur catnip scratched.&lt;/p&gt;

</code></pre></div>
<p dir="auto">The test case of aaabb should have 120 total permutations (5! = 120).  I followed Heap's algorithm as posted on wikipedia and calculated 120 permutations.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" 110 of the permutations are the following 9 strings which have same consecutive letters:"><pre class="notranslate"><code class="notranslate"> 110 of the permutations are the following 9 strings which have same consecutive letters:
</code></pre></div>
<ol dir="auto">
<li>
<p dir="auto">aaabb</p>
</li>
<li>
<p dir="auto">aabab</p>
</li>
<li>
<p dir="auto">aabba</p>
</li>
<li>
<p dir="auto">abaab</p>
</li>
<li>
<p dir="auto">abbaa</p>
</li>
<li>
<p dir="auto">baaab</p>
</li>
<li>
<p dir="auto">baaba</p>
</li>
<li>
<p dir="auto">babaa</p>
</li>
<li>
<p dir="auto">bbaaa</p>
<p dir="auto">Removing all examples of these 9 permutations leaves 10 permutations that appear to pass the consecutive letters case as I read and interpret it it.   Btw, I found these matches using the regular expression <code class="notranslate">/(.)\1+/g;</code><br>
However, the answer on the challenge page says that there are 12 permutations from this given test case.  Which of the nine listed permutations count as valid answers?</p>
</li>
</ol>
<p dir="auto">This same issue affects the "abcdefa" and "abfdefa" strings.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// array that will hold the permutations
// it is emptied each time the permAlone function is called
var perms = [];

function permAlone(str) {
     var strArr = str.split(&quot;&quot;);
     //console.log(strArr);

     // empty the answer array each time this function is called
     perms = [];
     permutator(strArr.length, strArr);
     console.log(str + &quot; - num perms: &quot; + perms.length);
     // console.log(perms.join(&quot;, &quot;));
     perms = removeDuplicates();
     console.log(perms.length);
     return perms.length;
}

/**
 * removeDuplicates
 *   does a filter to remove array elments with consecutive duplicate characters &quot;aa&quot;, &quot;bbb&quot;, etc.
 * @returns - array with duplicate elements removed
 */
function removeDuplicates() {
     var removeCounter = 0;
     var regEx = /(.)\1+/g;

     var finalPerms = perms.filter(function (element, index, array) {
          if (element.match(regEx)) {
               console.log(&quot;removed: &quot; + element);
               removeCounter++;
               return false;
          }
          else {
               return true;
          }
     });
     console.log(&quot;Removed: &quot; + removeCounter);
     return finalPerms;
}

/**
 * permutator
 *
 * @param {any} arr - an array of characters to be permutated
 * @return perms - an array of permutated strings
 */
function permutator(n, array) {

     function swap(a, b) {
          var temp = array[a];
          array[a] = array[b];
          array[b] = temp;
     }

     if (n === 1) {
          perms.push(array.join(&quot;&quot;));
          //return array;
     }
     else {
          for (var i = 0; i &lt; n - 1; i++) {
               permutator(n - 1, array);


               if (i % 2 === 0) {
                    swap(i, n - 1);
               }
               else {
                    swap(0, n - 1);
               }
          }
          // console.log(array.toString());
          permutator(n - 1, array);
     }
}"><pre class="notranslate"><code class="notranslate">// array that will hold the permutations
// it is emptied each time the permAlone function is called
var perms = [];

function permAlone(str) {
     var strArr = str.split("");
     //console.log(strArr);

     // empty the answer array each time this function is called
     perms = [];
     permutator(strArr.length, strArr);
     console.log(str + " - num perms: " + perms.length);
     // console.log(perms.join(", "));
     perms = removeDuplicates();
     console.log(perms.length);
     return perms.length;
}

/**
 * removeDuplicates
 *   does a filter to remove array elments with consecutive duplicate characters "aa", "bbb", etc.
 * @returns - array with duplicate elements removed
 */
function removeDuplicates() {
     var removeCounter = 0;
     var regEx = /(.)\1+/g;

     var finalPerms = perms.filter(function (element, index, array) {
          if (element.match(regEx)) {
               console.log("removed: " + element);
               removeCounter++;
               return false;
          }
          else {
               return true;
          }
     });
     console.log("Removed: " + removeCounter);
     return finalPerms;
}

/**
 * permutator
 *
 * @param {any} arr - an array of characters to be permutated
 * @return perms - an array of permutated strings
 */
function permutator(n, array) {

     function swap(a, b) {
          var temp = array[a];
          array[a] = array[b];
          array[b] = temp;
     }

     if (n === 1) {
          perms.push(array.join(""));
          //return array;
     }
     else {
          for (var i = 0; i &lt; n - 1; i++) {
               permutator(n - 1, array);


               if (i % 2 === 0) {
                    swap(i, n - 1);
               }
               else {
                    swap(0, n - 1);
               }
          }
          // console.log(array.toString());
          permutator(n - 1, array);
     }
}
</code></pre></div>