12 lines
207 B
Go
12 lines
207 B
Go
package pal
|
|
|
|
func IsPal(s string) bool {
|
|
mid := len(s) / 2
|
|
last := len(s) - 1
|
|
for i := 0; i < mid; i++ {
|
|
if s[i] != s[last-i] {
|
|
return false
|
|
}
|
|
}
|
|
return true
|
|
}
|