https://www.nowcoder.com/questionTerminal/50959b5325c94079a391538c04267e15
import java.util.*;
public class GrayCode {
public String[] getGray(int n) {
// write code here
String[] ret = null;
if(n == 1){
return new String[] {"0","1"};
}else{
String[] tmp = getGray(n - 1);
ret = new String[tmp.length * 2];
for(int i = 0;i < tmp.length;i++){
ret[i] = "0" + tmp[i];
ret[ret.length - 1 - i] = "1" + tmp[i];
}
}
return ret;
}
}