finished leetcode Gray Code for #1 time