Created
April 13, 2019 20:18
-
-
Save marti1125/2546860b31f9e7fd4dbdf2dd357b93cb to your computer and use it in GitHub Desktop.
checkPalindrome
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "strings" | |
func checkPalindrome(inputString string) bool { | |
var p []string | |
for i := len(inputString)-1; i >= 0; i-- { | |
p = append(p, string(inputString[i])) | |
} | |
sj := strings.Join(p,"") | |
if sj == inputString { | |
return true | |
} else { | |
return false | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment