title: Remove duplicates from integer array
body: <p>I having a problem with coding this:</p>
  
  <p>Write a static method named <code>removeDuplicates</code> that takes as input an array of integers and returns as a result a new array of integers with all duplicates removed.
  For example, if the input array has the elements {4, 3, 3, 4, 5, 2, 4} the resulting array
  should be {4, 3, 5, 2}</p>
  
  <p>Here's what I have done so far </p>
  
  <pre><code>public static int[] removeDuplicates(int []s){
      int [] k = new int[s.length];
      k[0]=s[0];
      int m =1;
      for(int i=1;i&lt;s.length;++i){
          if(s[i]!=s[i-1]){
              k[m]=s[i];
              ++m;
          }//endIF
      }//endFori
      return k;
  }//endMethod
  </code></pre>