The TransCompilator

Solved LeetCode program · 89 of 1,000

#0089 · Gray Code

Medium Math chunk-02.md

Original English source

The count is 4. The codes is an empty list of whole numbers.
For every value from 0 to one less than count.
The shifted is shift value right by 1. The code is exclusive or of value and shifted. Place code into codes.

For each code in codes, report code.

Open in Playground Browse all 1,000 problems

Expected stdout

0
1
3
2