public class Solution {
public int maxProduct(String[] words) {
if (words == null || words.length == 0) return 0;
int len = words.length;
int[] count = new int[len];
for (int i = 0; i < len; i++) {
String word = words[i];
count[i] = 0;
for (int j = 0; j < word.length(); j++) {
count[i] |= 1 << (word.charAt(j) - 'a');
}
}
int product = 0;
for (int i = 0; i < len; i++) {
for (int j = i + 1; j < len; j++) {
if ((count[i] & count[j]) == 0 && words[i].length() * words[j].length() > product) {
product = words[i].length() * words[j].length();
}
}
}
return product;
}
}