An n-bit gray code sequence is a sequence of 2^n integers where:
[0, 2^n - 1]0Given an integer n, return any valid n-bit gray code sequence.
Example 1:
Input: n = 2
Output: [0,1,3,2]
Explanation:
00 - 001 - 111 - 310 - 2Example 2:
Input: n = 1
Output: [0,1]
1 <= n <= 16