随笔分类 - 位操作
摘要:题目: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...
阅读全文
摘要:题目: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...
阅读全文
摘要:题目:在一个数组中,除了两个数外,其余数都是两两成对出现,找出这两个数,要求时间复杂度O(n),空间复杂度O(1)分析:这道题考察位操作:异或(^),按位与(&),移位操作(>>, >= 1; } int num1 = 0, num2 = 0; int tm...
阅读全文
浙公网安备 33010602011771号