My submission came out with wrong answer with the following hints:

```
Input: 0
Output: []
Expected: [0]
```

I think that 0 bit Gray Code can not form any code word, so the right answer should be [], but not [0], which, in my perspective, means there is one code word can be form when n = 0.

Am I wrong?

my code:

```
class Solution {
public:
vector<int> grayCode(int n) {
vector<int> Gray;
if(n<1) return Gray;
Gray.push_back(0);
Gray.push_back(1);
for (int i = 1; i<n; ++i){
int len = Gray.size();
for (int j = len-1; j>=0; --j){
Gray.push_back(Gray[j]+ (1<<i));
}
}
return Gray;
}
};
```