title: Hackerrank Compare the Triplets Javascript
body: <p>I'm aware that there is already a thread on this topic, however I'm just wondering why this solution isn't working for HackerRank's "Compare the Triplets" problem?  I'm only getting an output of 1 when it should be 1 1. </p>
  
  <p>The problem states that if a0 > b0, a1 > b1, or a2 > b2 (and vice versa), the result should print separate spaced integers of 1 for any comparison that is not equal.    </p>
  
  <p><a href="https://www.hackerrank.com/challenges/compare-the-triplets/problem" rel="nofollow noreferrer">https://www.hackerrank.com/challenges/compare-the-triplets/problem</a></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function solve(a0, a1, a2, b0, b1, b2) {
      
      var solution = []
  
      if (a0 &gt; b0 || a1 &gt; b1 || a2 &gt; b2) {
          solution += 1;
      } else if (a0 &lt; b0 || a1 &lt; b1 || a2 &lt; b2 ) {
          solution += 1;
      }
      return solution.split('');
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>---- UPDATE ----</p>
  
  <p>The code above only worked for the first test case and not the rest.  The code below, although clunky, worked for all test cases.  </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function solve(a0, a1, a2, b0, b1, b2) {
      var s = [0, 0];
      
      if (a0 &gt; b0) {s[0] += 1;} 
      if (a1 &gt; b1) {s[0] += 1;} 
      if (a2 &gt; b2) {s[0] += 1;}
      if (a0 &lt; b0) {s[1] += 1;}
      if (a1 &lt; b1) {s[1] += 1;}
      if (a2 &lt; b2) {s[1] += 1;}
          
      return s;
  }</code></pre>
  </div>
  </div>
  </p>