title: tallying elements in an array
body: <p>So, I'm trying to tally the elements of an array.  By this I mean, I have a large array, and each element will have multiples of itself throughout the array.  I am trying to figure out how many times each element occurs,  however I keep running into the issue of there being duplicate tallies.  Since "x" could exist at 12 different places in the array, when I loop through it and keep a running sum, I get the tally for "x" 12 different times.  Does anyone know of a simpler/better way to keep a tally of an array with no duplicates?</p>
  
  <p>My code is:</p>
  
  <p>where count is the number of elements</p>
  
  <pre><code>    for(i=0;i&lt;count;i++)
      {
  
  
              for(x=0; x&lt;count;x++)
              {
                      if(array[i]==array[x])
                      {
                              tallyz++;
                      }   
  
              }
  
                      tally[i]=tallyz-1;
                      tallyz=0;
                      }
  
      }
  </code></pre>