class Solution:
def pathInZigZagTree(self, label: int) -> List[int]:
ans = []
label = bin(label)[2:]
for i in range(0,len(label)):
tmp = int(label[:i+1],2)
if (i+len(label))%2 == 0:
ans.append(3*2**i-1-tmp)
else:
ans.append(tmp)
return ans