From 1f760b37436356be4c99ce8b8f513bc78f5babbe Mon Sep 17 00:00:00 2001 From: ductnn Date: Tue, 12 Dec 2023 00:49:28 +0700 Subject: [PATCH] update --- leetcode/136.SingleNumber/singleNumber.go | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 leetcode/136.SingleNumber/singleNumber.go diff --git a/leetcode/136.SingleNumber/singleNumber.go b/leetcode/136.SingleNumber/singleNumber.go deleted file mode 100644 index 23c3d55..0000000 --- a/leetcode/136.SingleNumber/singleNumber.go +++ /dev/null @@ -1,23 +0,0 @@ -package main - -import ( - "fmt" -) - -func singleNumber(nums []int) int { - result := 0 - if len(nums) == 1 { - return nums[0] - } - - for _, v := range nums { - result ^= v - } - - return result -} - -func main() { - nums := []int{4, 1, 2, 1, 2} - fmt.Println(singleNumber(nums)) -}