From c452f234feeb67630711d348f498ea783aafd8e8 Mon Sep 17 00:00:00 2001 From: ZombieChibiXD <43260238+ZombieChibiXD@users.noreply.github.com> Date: Wed, 30 Oct 2019 22:38:12 +0800 Subject: [PATCH] Added ZombieChibiXD_Palindrome.go --- CONTRIBUTORS.md | 6 ++++++ go/ZombieChibiXD_Palindrome.go | 18 ++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 go/ZombieChibiXD_Palindrome.go diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 09a44454..d36783c4 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -444,3 +444,9 @@ Name: [Abhishek Singh](https://github.com/n6wbi6)
Place: India
Coding Experience: 2 years of coding experience in C and python.
Email: abhisheksingh.g07@gmail.com
+ +Name: [Sazeim Saheem](https://github.com/ZombieChibiXD)
+Place: Bali, Indonesia
+Field Experience: System Administrator, Junior web developer, beta-tester, and debugger
+Coding Experience: 3 years of learning & coding experience in C++, Java, Javascript/NodeJS, PHP, Vue.js, Laravel Framework, GoLang and python.
+Email: chibisd10@gmail.com
diff --git a/go/ZombieChibiXD_Palindrome.go b/go/ZombieChibiXD_Palindrome.go new file mode 100644 index 00000000..a233bc55 --- /dev/null +++ b/go/ZombieChibiXD_Palindrome.go @@ -0,0 +1,18 @@ +package main + +import ( + "fmt" + "strings" +) + +func main() { + fmt.Println(isPalindrome("Natetan is I si Natetan")) +} + +func isPalindrome(text string) bool{ return strings.ToLower(text) == Reverse(strings.ToLower(text)) } + +func Reverse(s string) string { + r := []rune(s) + for i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 { r[i], r[j] = r[j], r[i] } + return string(r) +} \ No newline at end of file