n = 0 mean the length is 0, so the program should return .
Go fix the test case please.
I am thinking about the same thing
Actually, for n = 0, 2^n = 1, so  is the correct answer.
n means the lenght, so for n=0, it should return 
the length of |0| is 0, so  are all the codes of length 0.  is correct, not 
It should not be , but [special empty-string symbol]. From wikipedia: "The one-bit Gray code is G1 = (0, 1). This can be thought of as built recursively as above from a zero-bit Gray code G0 = ( Λ ) consisting of a single entry of zero length."
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.