Pattern 22: LeetCode Interview Patterns24 sections · 736 units
Open in CourseQuiz: Bitwise Addition
Test your understanding
Check Your Understanding
To add without +/-, you use XOR for the sum and AND for the carry. What must you do with the carry?
- A.XOR it with the original numbers
- B.Discard it
- C.Right shift it by 1
- D.Left shift it by 1, then add it to the XOR result