public int maxProduct(String[] words) {
        if (words == null) return 0;

        // Maps each word to a bit vector
        int[] map = new int[words.length];
        for (int i = 0; i < words.length; ++i) {
            for (int j = 0; j < words[i].length(); ++j) {
                int n = words[i].charAt(j) - 'a';
                map[i] |= 1 << n;
            }
        }
        int maxLen = 0;
        for (int i = 1; i < words.length; ++i) {
            for (int j = 0; j < i; ++j) {
                if ((map[i] & map[j]) == 0) {
                    maxLen = Math.max(maxLen, words[i].length() * words[j].length());
                }
            }
        }
        return maxLen;
    }