随笔分类 -  位操作

摘要:题目: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 as... 阅读全文
posted @ 2015-12-17 12:44 lasclocker 阅读(176) 评论(0) 推荐(0)
摘要:题目:Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array.For example,Given nums = [0, 1... 阅读全文
posted @ 2015-11-22 20:58 lasclocker 阅读(127) 评论(0) 推荐(0)
摘要:题目:在一个数组中,除了两个数外,其余数都是两两成对出现,找出这两个数,要求时间复杂度O(n),空间复杂度O(1)分析:这道题考察位操作:异或(^),按位与(&),移位操作(>>, >= 1; } int num1 = 0, num2 = 0; int tm... 阅读全文
posted @ 2015-10-25 22:03 lasclocker 阅读(426) 评论(0) 推荐(0)