From 7cea903bfca6e5aa9554208fcd9dd185c8186ca2 Mon Sep 17 00:00:00 2001 From: mhhung Date: Thu, 14 Aug 2025 15:44:54 +0800 Subject: [PATCH] feat : add go solution --- 202508/2264 largestGoodInteger/GO/main.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 202508/2264 largestGoodInteger/GO/main.go diff --git a/202508/2264 largestGoodInteger/GO/main.go b/202508/2264 largestGoodInteger/GO/main.go new file mode 100644 index 0000000..f5dc4a7 --- /dev/null +++ b/202508/2264 largestGoodInteger/GO/main.go @@ -0,0 +1,23 @@ +package main + +import "fmt" + +func LargestGoodInteger(num string) string { + max := "" + + for i := 0; i < len(num)-2; i++ { + if num[i] == num[i+1] && num[i] == num[i+2] { + current := string([]byte{num[i], num[i], num[i]}) + + if current > max { + max = current + } + } + } + + return max +} + +func main() { + fmt.Println(LargestGoodInteger("7636669283")) +}