en/lcci/17.1/ #4013
Replies: 1 comment
|
class Solution { }; Why use XOR and AND operations for addition? Intuition behind XOR: a = 14 (which is 1110 in binary). a = 14 (1110), b = 4 (0100). Second step (XOR and AND again): Now a = 10 (1010) and b = 8 (1000). Third step (XOR and AND again): Now a = 2 (0010) and b = 16 (10000). Final Result: Why continue until no carry? |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
en/lcci/17.1/
LeetCode solutions in any programming language
https://leetcode.doocs.org/en/lcci/17.1/
All reactions