title: counting number of unique elements
body: <p>Hi so I am supposed to count the number of unique elements after an array sort excluding duplicates but i'm getting the wrong output.</p>
  
  <pre><code>In in = new In(args[0]);
  int[] whitelist = in.readAllInts();
  Arrays.sort(whitelist);
  
  int count = 0;
     for (int i = 0; i &lt; whitelist.length; i++) {
         if (whitelist[i] == whitelist[count]) {
             count++;
         }
     }
  while (!StdIn.isEmpty()) {
      int key = StdIn.readInt();
      rank(key, whitelist);
  }
     System.out.println(count);
  </code></pre>
  
  <p>}
  }</p>
  
  <p>expected output: java InstrumentedBinarySearch tinyW.txt &lt; tinyT.txt</p>
  
  <p>65</p>
  
  <p>got: 16</p>
  
  <p>Did i count the number of duplicates or something?</p>