読者です 読者をやめる 読者になる 読者になる

Maximum Product of Word Lengths

Bit Manipulation Cracking The Coding Interview

Problem

leetcode.com

Solution

This problem can be solved effectively by using bit manipulation. We can manage the count of appearance of each letters. Lower case letters are transformed to Integer within 26. This takes 0(N2) time.

Source Code