Write a function IsPalindrome that checks if a given string is a palindrome. A palindrome is a word, phrase, number, or other sequence of characters that reads the same forward and backward (ignoring spaces, punctuation, and capitalization).
func IsPalindrome(s string) bool- A string
scontaining letters, numbers, spaces and punctuation.
- A boolean value:
trueif the string is a palindrome,falseotherwise.
- The function should be case-insensitive ("A" is the same as "a").
- The function should ignore spaces and punctuation marks.
- The function should handle alphanumeric strings.
"racecar"
true
"A man, a plan, a canal: Panama"
true
"hello"
false
- Fork the repository.
- Clone your fork to your local machine.
- Create a directory named after your GitHub username inside
challenge-17/submissions/. - Copy the
solution-template.gofile into your submission directory. - Implement the
IsPalindromefunction. - Test your solution locally by running the test file.
- Commit and push your code to your fork.
- Create a pull request to submit your solution.
Run the following command in the challenge-17/ directory:
go test -v