LeetCode – Maximum Product of Word Lengths (Java)

Given a string array words, find the maximum value of length(word[i]) * length(word[j]) where the two words do not share common letters. You may assume that each word will contain only lower case letters. If no such two words exist, return 0. Java Solution public int maxProduct(String[] words) { if(words==null || words.length==0) return 0;   … Read more