From 4988e110979561fef114c89c8a2b4d8cb964df9b Mon Sep 17 00:00:00 2001 From: ductnn Date: Mon, 27 Nov 2023 16:28:00 +0700 Subject: [PATCH] add sol --- leetcode/89.GrayCode/grayCode.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 leetcode/89.GrayCode/grayCode.go diff --git a/leetcode/89.GrayCode/grayCode.go b/leetcode/89.GrayCode/grayCode.go new file mode 100644 index 0000000..4f19b21 --- /dev/null +++ b/leetcode/89.GrayCode/grayCode.go @@ -0,0 +1,18 @@ +package main + +import ( + "fmt" +) + +func grayCode(n int) []int { + ans := []int{} + for i := 0; i < 1<>1)) + } + return ans +} + +func main() { + n := 2 + fmt.Println(grayCode(n)) +}