<p dir="auto">Challenge <a href="http://freecodecamp.com/challenges/waypoint-create-a-set-of-checkboxes" rel="nofollow">http://freecodecamp.com/challenges/waypoint-create-a-set-of-checkboxes</a> has an issue.</p>
<p dir="auto">To reproduce: try the challenge and when you are going to name the checkboxes the challenge will be correct if you only type one name.</p>
<p dir="auto">Expected: The challenge will only mark as complete if all three checkboxes have the same name.</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/9614642/9503734/26254bb8-4c0f-11e5-9ab4-6babeae95cb8.jpg"><img src="https://cloud.githubusercontent.com/assets/9614642/9503734/26254bb8-4c0f-11e5-9ab4-6babeae95cb8.jpg" alt="issue-challenge-checkboxes" style="max-width: 100%;"></a></p>
<p dir="auto">Challenge <a href="https://www.freecodecamp.com/challenges/smallest-common-multiple" rel="nofollow">Smallest Common Multiple</a> has an issue.<br>
User Agent is: <code class="notranslate">Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.76 Safari/537.36</code>.<br>
Please describe how to reproduce this issue, and include links to screenshots if possible.</p>
<p dir="auto">Hi, my code for the smallest common multiple challenge works but if I input numbers larger than 5, it gives me the infinite loop notification and the //noprotect takes too long.  If it isn't a bug, could it have something to do with the efficiency of my algorithm and how I am pushing and scanning an increasingly larger array?  I tried using more efficient methods like modulus or poping old values but I have only been able to max at an input of 7, as opposed to the 13 and beyond per the test cases.</p>
<p dir="auto">My code:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="//In progress: It works but has problem with efficiency
function smallestCommons(arr) 
  {
    //Variable declarations
      var arr1 = []; //Values inside boundaries of arr
      var arr2 = []; //Multipliers of arr1
      var countDuplicates = 0; //Used to find match in arr2
      var result = 0; //Result dump

    //Sort and collect input values and dump to arr1
      arr.sort(function(a,b){return a - b;});
      for (i = arr[0]; i &lt;= arr[1]; i++)
        {
          arr1.push(i);
        }
    //Increment multiplier and dump into arr2
      var j = 1;
      while(true)//
        {  //Multiply the values of arr1 and dump to arr2
             for (var k = 0;  k &lt; arr1.length; k++)
              { 
                arr2.push(arr1[k] * j);
              }
          //Check for internal duplicates
            for (var l = 0; l &lt; arr2.length; l++)
              {
                for (var m = 0; m &lt; arr2.length; m++)
                  {
                    if (arr2[l] == arr2[m])
                      {
                        countDuplicates++;
                      }
                  }
              //Collect the result if there is a match equal to arr1.length
                if (countDuplicates &gt;= arr1.length)
                  {
                    return arr2[l];
                  }                
                countDuplicates = 0;
              }
          j++;
        }
  }
smallestCommons([1, 3]);
"><pre class="notranslate"><span class="pl-c">//In progress: It works but has problem with efficiency</span>
<span class="pl-k">function</span> <span class="pl-en">smallestCommons</span><span class="pl-kos">(</span><span class="pl-s1">arr</span><span class="pl-kos">)</span> 
  <span class="pl-kos">{</span>
    <span class="pl-c">//Variable declarations</span>
      <span class="pl-k">var</span> <span class="pl-s1">arr1</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-kos">]</span><span class="pl-kos">;</span> <span class="pl-c">//Values inside boundaries of arr</span>
      <span class="pl-k">var</span> <span class="pl-s1">arr2</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-kos">]</span><span class="pl-kos">;</span> <span class="pl-c">//Multipliers of arr1</span>
      <span class="pl-k">var</span> <span class="pl-s1">countDuplicates</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span><span class="pl-kos">;</span> <span class="pl-c">//Used to find match in arr2</span>
      <span class="pl-k">var</span> <span class="pl-s1">result</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span><span class="pl-kos">;</span> <span class="pl-c">//Result dump</span>

    <span class="pl-c">//Sort and collect input values and dump to arr1</span>
      <span class="pl-s1">arr</span><span class="pl-kos">.</span><span class="pl-en">sort</span><span class="pl-kos">(</span><span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-s1">a</span><span class="pl-kos">,</span><span class="pl-s1">b</span><span class="pl-kos">)</span><span class="pl-kos">{</span><span class="pl-k">return</span> <span class="pl-s1">a</span> <span class="pl-c1">-</span> <span class="pl-s1">b</span><span class="pl-kos">;</span><span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
      <span class="pl-k">for</span> <span class="pl-kos">(</span><span class="pl-s1">i</span> <span class="pl-c1">=</span> <span class="pl-s1">arr</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-kos">]</span><span class="pl-kos">;</span> <span class="pl-s1">i</span> <span class="pl-c1">&lt;=</span> <span class="pl-s1">arr</span><span class="pl-kos">[</span><span class="pl-c1">1</span><span class="pl-kos">]</span><span class="pl-kos">;</span> <span class="pl-s1">i</span><span class="pl-c1">++</span><span class="pl-kos">)</span>
        <span class="pl-kos">{</span>
          <span class="pl-s1">arr1</span><span class="pl-kos">.</span><span class="pl-en">push</span><span class="pl-kos">(</span><span class="pl-s1">i</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
        <span class="pl-kos">}</span>
    <span class="pl-c">//Increment multiplier and dump into arr2</span>
      <span class="pl-k">var</span> <span class="pl-s1">j</span> <span class="pl-c1">=</span> <span class="pl-c1">1</span><span class="pl-kos">;</span>
      <span class="pl-k">while</span><span class="pl-kos">(</span><span class="pl-c1">true</span><span class="pl-kos">)</span><span class="pl-c">//</span>
        <span class="pl-kos">{</span>  <span class="pl-c">//Multiply the values of arr1 and dump to arr2</span>
             <span class="pl-k">for</span> <span class="pl-kos">(</span><span class="pl-k">var</span> <span class="pl-s1">k</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span><span class="pl-kos">;</span>  <span class="pl-s1">k</span> <span class="pl-c1">&lt;</span> <span class="pl-s1">arr1</span><span class="pl-kos">.</span><span class="pl-c1">length</span><span class="pl-kos">;</span> <span class="pl-s1">k</span><span class="pl-c1">++</span><span class="pl-kos">)</span>
              <span class="pl-kos">{</span> 
                <span class="pl-s1">arr2</span><span class="pl-kos">.</span><span class="pl-en">push</span><span class="pl-kos">(</span><span class="pl-s1">arr1</span><span class="pl-kos">[</span><span class="pl-s1">k</span><span class="pl-kos">]</span> <span class="pl-c1">*</span> <span class="pl-s1">j</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
              <span class="pl-kos">}</span>
          <span class="pl-c">//Check for internal duplicates</span>
            <span class="pl-k">for</span> <span class="pl-kos">(</span><span class="pl-k">var</span> <span class="pl-s1">l</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span><span class="pl-kos">;</span> <span class="pl-s1">l</span> <span class="pl-c1">&lt;</span> <span class="pl-s1">arr2</span><span class="pl-kos">.</span><span class="pl-c1">length</span><span class="pl-kos">;</span> <span class="pl-s1">l</span><span class="pl-c1">++</span><span class="pl-kos">)</span>
              <span class="pl-kos">{</span>
                <span class="pl-k">for</span> <span class="pl-kos">(</span><span class="pl-k">var</span> <span class="pl-s1">m</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span><span class="pl-kos">;</span> <span class="pl-s1">m</span> <span class="pl-c1">&lt;</span> <span class="pl-s1">arr2</span><span class="pl-kos">.</span><span class="pl-c1">length</span><span class="pl-kos">;</span> <span class="pl-s1">m</span><span class="pl-c1">++</span><span class="pl-kos">)</span>
                  <span class="pl-kos">{</span>
                    <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">arr2</span><span class="pl-kos">[</span><span class="pl-s1">l</span><span class="pl-kos">]</span> <span class="pl-c1">==</span> <span class="pl-s1">arr2</span><span class="pl-kos">[</span><span class="pl-s1">m</span><span class="pl-kos">]</span><span class="pl-kos">)</span>
                      <span class="pl-kos">{</span>
                        <span class="pl-s1">countDuplicates</span><span class="pl-c1">++</span><span class="pl-kos">;</span>
                      <span class="pl-kos">}</span>
                  <span class="pl-kos">}</span>
              <span class="pl-c">//Collect the result if there is a match equal to arr1.length</span>
                <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">countDuplicates</span> <span class="pl-c1">&gt;=</span> <span class="pl-s1">arr1</span><span class="pl-kos">.</span><span class="pl-c1">length</span><span class="pl-kos">)</span>
                  <span class="pl-kos">{</span>
                    <span class="pl-k">return</span> <span class="pl-s1">arr2</span><span class="pl-kos">[</span><span class="pl-s1">l</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
                  <span class="pl-kos">}</span>                
                <span class="pl-s1">countDuplicates</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span><span class="pl-kos">;</span>
              <span class="pl-kos">}</span>
          <span class="pl-s1">j</span><span class="pl-c1">++</span><span class="pl-kos">;</span>
        <span class="pl-kos">}</span>
  <span class="pl-kos">}</span>
<span class="pl-en">smallestCommons</span><span class="pl-kos">(</span><span class="pl-kos">[</span><span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-c1">3</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>