The TransCompilator

Solved LeetCode program · 461 of 1,000

#0650 · 2 Keys Keyboard

Medium Math chunk-10.md

Original English source

The cells is 3. The moves is 0. The divisor is 2.
Repeat while cells is more than 1.
If cells modulo divisor is 0, add divisor to moves, set cells to cells divided by divisor. If cells modulo divisor is not 0, add 1 to divisor.

Show moves.

Open in Playground Browse all 1,000 problems

Expected stdout

3