Hey, everyone. I'm new to Java and I have 2D LinkedList like this:
LinkedList<LinkedList<String>> albums = new LinkedList<LinkedList<String>>();
Which is filled with data like so:
if (!artist.isEmpty() && !name.isEmpty()) { albums.add(new LinkedList<String>()); albums.getLast().add(artist.toString()); albums.getLast().add(name.toString()); }
But I want to make sure my list has no duplicate albums. How to check whenever my albums list already contains same pair of artist and name?