title: Bitwise Operation to check string is unique
body: <p>This is the code to check if the input string is unique or not. What is being done at Line no. 11 : <code>check |=(1&lt;&lt;val)</code> and why is the check's binary form so?</p>
  
  <pre><code>public boolean checkUnique(String str)
   {
       int check=0;
       for(int i=0; i&lt;str.length();i++)
       {
           int val = str.charAt(i)-'a';
           if((check &amp; (1 &lt;&lt; val)) &gt;0)
           {
               return false;
           }
           check |= (1&lt;&lt;val);
           System.out.println("check "+Integer.toBinaryString(check));
       }
       return true;
   } 
  </code></pre>
  
  <p><br/></p>
  
  <pre><code>I/P : "asdfgh"
  O/P () : 
  0
  check 1
  18
  check 1000000000000000001
  3
  check 1000000000000001001
  5
  check 1000000000000101001
  6
  check 1000000000001101001
  7
  check 1000000000011101001
  </code></pre>