The TransCompilator

Solved LeetCode program · 268 of 1,000

#0371 · Sum of Two Integers

Medium Math chunk-06.md

Original English source

The first is 1. The second is 2. The left is first. The right is second.
Repeat while right is not 0.
The carry is bitwise and of left and right. Set left to exclusive or of left and right. Set right to shift carry left by 1.

Show left.

Open in Playground Browse all 1,000 problems

Expected stdout

3