89. Gray Code
Link
key ideas
Create an array res with size 2^n
Set res[0] = 0 as the base case
Iterate over the array, trying to insert a valid number in every iteration.
To find a valid number, we create another loop, and in this nested loop:
toggle the righ...
brianhu.hashnode.dev2 min read