https://discuss.leetcode.com/category/97/gray-code
本来是想用深度优先搜索,后来发现虽然可以用深度优先搜索把答案做出来,但是答案对顺序有一定的要求。这样DFS就失败了(也许是我自己没想出来~GG)。
'''
from up to down, then left to right
0 1 11 110
10 111
101
100
start: [0]
i = 0: [0, 1]
i = 1: [0, 1, 3, 2]
i = 2: [0, 1, 3, 2, 6, 7, 5, 4]