title: How can I find minimum and unique element of array in c++?
body: <p>I have array(of numbers) with size N. I need to find minimum element which is unique,so if <code>arr[5] ={1,2,3,1,2}</code>, answer is 3.
  I tried that with following code:</p>
  
  <pre><code>Int n = sizeof(arr)/sizeof(arr[0]);
  sort(arr,arr + n);
  for(int i = 0;i&lt;N;i++){
       for(int j = 0;j&lt;N;j++){
          if(arr[i] == arr[j]){
             remove(arr,arr+n,i);
             remove(arr,arr+n,j);
          }
      }
  }
  </code></pre>
  
  <p>But problem is that this only work if I have 2 identical elements of arr.I could create if conditions for number of identical, but I can have 3 or 4 or 1000,so it will be pretty odd. So what is more elagant way to do this? Thank you in advance.</p>