title: Find if a string is unique or not
body: <p>I want to use hashtable to find unique characters as it seems more efficient to me so for example, hello in hashtable would be=> {h:1,e:1,l:2,o:1} &amp; since value is more than 1 then string isnt unique. I know I can do ascii way of counting unique characters but I want to implement the hashtable way.</p>
  
  <p>Please note, I do not want a regex implementation.</p>
  
  <pre><code>static void findHashUnique(String str)
  {
      Hashtable&lt;Character, Integer&gt; ht = new Hashtable&lt;Character, Integer&gt;();
      for(int i=0;i&lt;str.length();i++)
      {
          int cnt=1;
  
          if(!ht.containsKey(str.charAt(i)))
          {
              ht.put(str.charAt(i), cnt);
          }
      }
      System.out.print(ht);
  }
  </code></pre>
  
  <p>I am stuck at the part of how will I first initialize the hashtable &amp; also check if value exists then increment. In case of 'l' it will increment to 2 instead of being 1 since the key is the same.
  Also Is this solution efficient?</p>