title: How to remove comma separated duplicated string values and get last two values
body: <p>I want to remove comma separated duplicate string values like :</p>
  
  <pre><code>String str = "2,4,3,12,25,2,4,3,6,2,2,2";
  </code></pre>
  
  <p>And i want to output like this:</p>
  
  <pre><code>String str1 = "6,2";
  </code></pre>
  
  <p>please tell how to do this i'll my self but i can't solve this</p>