title: Comparison of one element in array to all other elements in same array
body: <p>I understand that we can compare each element of the array with every other in this manner: </p>
  
  <pre><code>    for (f = 0; f &lt; length2; f++) {
      for (p = f + 1; p &lt; length2 ; p++) {
          if(!(compareThem(split[f],split[p]) == 1) &amp;&amp; (split[f] != 0) &amp;&amp; (split[p] != 0)) {
              no_of_unique++;
          }
      }
  }
  </code></pre>
  
  <p>However, I only want no_of_unique to increase after checking the element of index f with ALL the element of index p. This, however, checks the element f with p= f + 1, increases no_of_unique, then checks the other elements and increases it for each case. I only need it to increase after its checked ALL of the elements. Any help would be appreciated. </p>
  
  <p>P.S The compareThem function basically just returns 1 if they are equal to one another.</p>