title: Removing duplicates from an array list of characters using a loop?
body: <pre><code>public static ArrayList&lt;Character&gt; removeDuplicates (ArrayList&lt;Character&gt; data) {
      ArrayList&lt;Character&gt; newList = new ArrayList&lt;Character&gt;();
  
      for (int i = 0; i &lt; data.size() - 1; i++) {
        if (!newList.contains(data.get(i))) 
           newList.add(0,(data.get(i)));
      }
      return newList;
    }
  </code></pre>
  
  <p>Here is my code so far. I'm not understanding how this is not working </p>