Java ArrayList remove dupes without sets
- by Kieran
I'm having problems removing duplicates from an ArrayList. It's for an assignment for college. Here's the code I have already:
public int numberOfDiffWords() {
ArrayList<String> list = new ArrayList<>();
for(int i=0; i<words.size()-1; i++) {
for(int j=i+1; j<words.size(); j++) {
…