title: removing repeated elements for more than n times
body: <p>So as u can see i am trying to remove the element if it is repeated more than n times.</p>
  
  <p>for example:
  {1,2,4,5,6,5} and every element can be repeated once then i should return {1,2,4,5,6}</p>
  
  <p>here is what i came up with up till now :</p>
  
  <pre><code> public static int[] deleteNth(int[] elements, int maxOcurrences) {
      int times[] = new int[elements.length];
      for(int i =0;i&lt;elements.length;i++){
          for(int j =0;i&lt;elements.length;j++){
              if(elements[i]==elements[j]){
                  times[i]++;
                  if(times[i]&gt;maxOcurrences){
                      System.arraycopy(elements, j+1 , elements, j, elements.length - 1 - j);
                  }
              }
          }
      }
      return elements;
  }
  </code></pre>
  
  <p>is this right ? if not how can i correct it 
  (go easy on me as iam still a newbie),thanks</p>