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