add solution for gray_code