Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Prune a List of Lists

 
A Jaco
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to ensure that a List of Lists contains no element which is subsumed by another. Each nested List should contain at least one unique element compared to any other nested List.
This code works, but seems horribly inefficient. Is there a better way?

 
Alexei Kaigorodov
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A Jj wrote:

When list2.equals(list1), why don't you remove one of them?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic