title: Recursive way to count distinct number of elements in array
body: <p>Let's assume I have this array: ARR = {5, 7, 3, 3, 7, 5}
  and I also have the size ( = 6 in this example ) so the recursive function should return 3.</p>
  
  <p>this is the declaration of the function/method:</p>
  
  <pre><code>int f(arr, size);
  </code></pre>
  
  <p>I tried this thing:</p>
  
  <pre><code>count = 0;
  if(size == 1)
     return 1;
  if(x[i] != f(arr, size-1)
      count++;
  
  return count;
  </code></pre>
  
  <p>but it doesn't work, as f(arr, size-1) doesn't walk through all the elements of the array and compare.</p>
  
  <p>hopefully you guys could help!</p>