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

Maximum Product of Word Lengths

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 C…

ビット操作を用いて順列を求める

どの部分の要素を既に使用したかをbitを用いて管理する

Write a method to return all subsets of a set

Problem Write a method to return all subsets of a set Solution This problem can be solve by choosing each element or not. For example we given an array = {1, 2, 3}. First, we do the two patterns that we select 1 or not. By this operation, …