Given an array of Strings, return the number of sets of anagrams
Bug

I fed "aad" and "abc" to your program, and it considered the two strings anagrams of each other.  The problem is that you are trying to use a hashcode to determine whether two strings are anagrams of each other.  However:


Your hashcode is not very good because it simply adds the characters of the string together.  Therefore "aad" and "abc" were considered equivalent.
No matter what, a 32 bit hashcode is going to have some problems because there are more than 2^32 different anagram possibilities if you use long enough strings.  Even a 64 bit hashcode would not be enough.


I suggest that you think about creating a sorted string (i.e. alphabetized) as your hash key instead of a numerical hashcode.

Simplification

This code:


       if (mapList != null &amp;&amp; mapList.get(hashcode) == null) {
            List&lt;String&gt; list = new ArrayList&lt;String&gt;();
            mapList.put(hashcode, list);
            list.add(arr[i]);
        } else {
            List&lt;String&gt; list = mapList.get(hashcode);
            list.add(arr[i]);
        }



could be simplified to:

        List&lt;String&gt; list = mapList.get(hashcode);

        if (list == null) {
            list = new ArrayList&lt;String&gt;();
            mapList.put(hashcode, list);
        }
        list.add(arr[i]);