title: Remove duplicate items from a LinkedList, where the nested collection items can be in any order
body: <p>I have Nested LinkedList which contains Some elements.I want to Remove Duplicate Inner LinkedList From Outter LinkedList.The order of element Does not Matter.[Cat,Mouse,Dog] is Same As [Mouse,Cat,Dog] and I Want To remove 1 Of Them.
  example:</p>
  
  <p>suppose</p>
  
  <pre><code>[[Cat,Mouse,Dog],[Dog,Mouse,Cat],[Dog,Horse,Cat],[Dog,Tiger,Lion]] 
  </code></pre>
  
  <p>then I Want Output like this </p>
  
  <pre><code>[[Cat,Mouse,Dog],[Dog,Horse,Cat],[Dog,Tiger,Lion]]
  </code></pre>
  
  <p>I have tried it. but I want Optimal Solution......
  My code is as below</p>
  
  <pre><code>for (int iBoardListCnt = 0; this.roomCombinationsMasterList != null &amp;&amp; iBoardListCnt &lt; this.roomCombinationsMasterList.size(); iBoardListCnt++) {
  
          LinkedList&lt;Board&gt; alRoomCombinationList = new LinkedList&lt;&gt;();
          alRoomCombinationList = this.roomCombinationsMasterList.get(iBoardListCnt);
          ArrayList&lt;String&gt; alTemp = new ArrayList();
          for (int icount = 0; icount &lt; alRoomCombinationList.size(); icount++) {
              alTemp.add((alRoomCombinationList.get(icount).getRoomDescription() + alRoomCombinationList.get(icount).getDescription()).toString());
          }
          roomCombinationsMasterList.remove(iBoardListCnt);
  
  
  
          Collections.sort(alTemp, new Comparator&lt;String&gt;() {
              @Override
              public int compare(String s1, String s2) {
                  return s1.compareToIgnoreCase(s2);
              }
          });
  
          Iterator&lt;LinkedList&lt;Board&gt;&gt; iterator = roomCombinationsMasterList.iterator();
          while (iterator.hasNext()) {
  
              ArrayList&lt;String&gt; alTemp1 = new ArrayList&lt;&gt;();
              for (Board data : iterator.next()) {
                  alTemp1.add((data.getRoomDescription() + data.getDescription()).toString());
  
              }
              Collections.sort(alTemp1, new Comparator&lt;String&gt;() {
                  @Override
                  public int compare(String s1, String s2) {
                      return s1.compareToIgnoreCase(s2);
                  }
              });
  
              if (alTemp.equals(alTemp1)) {
                  iterator.remove();
                  continue;
              }
  
          }
  
          roomCombinationsMasterList.add(iBoardListCnt, alRoomCombinationList);
  
      }
  </code></pre>
  
  <p>In this code i have taken Fist element from Nested LinkedList. stored in to the temporally LinkedList i removed that element from main arraylist.Now i have the next element from LinkedList stored into 2nd temporally LinkedList. Sort both LinkedList using Comparator And using equals() method compare those two LinkedList.If both are same then remove 1 of them using Iterator.
  please give me Optimal Solution over It. </p>