FunctionRacerProblemsRace

Add Without Plus

EasyBitsPython, JavaScript, TypeScript

Return a + b without using the + or - operators. Use bit operations: the XOR of two numbers is their sum ignoring carries, and the AND shifted left by one is the carries.

Example 1

a 1
b 2
returns 3

3.

Example 2

a 7
b 8
returns 15

15.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More Bits problems