Gray Code

Generate a sequence of 2^n integers where each consecutive pair differs by exactly one bit in binary representation. The sequence starts at 0 and follows the Gray code ordering, where adjacent numbers have Hamming distance of 1.

Examples
Input: 0
Output: [0]
Hints

Gray Code

Generate a sequence of `2^n` integers where each consecutive pair differs by exactly one bit in binary representation. The sequence starts at 0 and follows the Gray code ordering, where adjacent numbers have Hamming distance of 1.