Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
一道很基础但有点意思的算法题,我的思路是
int my_xor(int a, int b) { return (a&~b)|(~a&b); }
不过网上还有一种比较奇妙的解法,返回(a|b)&(~a|~b) 结果确实正确,不过很好奇他怎么想到的...
(a|b)&(~a|~b)