
位运算的奇妙使用
sequenceGO
dev
展开
-
不使用比较运算符求两个数的最大值or最小值【位运算】
原题目:来自2012微软校园实习生笔试题 第10题(10) Assume both x and y are integers, which one of the followings returns the minimum of the two integers?(A) y ^ ((x ^ y) & ~(x (B) y ^(x ^ y)(C) x ^ (x ^ y)(D)转载 2015-12-04 18:19:25 · 3567 阅读 · 0 评论 -
Leetcode 338 Counting Bits
338. Counting BitsMy SubmissionsQuestionTotal Accepted: 6881 Total Submissions: 12500 Difficulty: MediumGiven a non negative integer number num. For every numbers i in the rang原创 2016-03-25 23:59:09 · 668 阅读 · 0 评论