Given a string , return whether this string is a palindrome string.
def is_palindrome_string(string: str) -> bool:
"""
Given a string <string>, return whether this string is a palindrome string.
for ANY CONTINUOUS SEGMENT OF ALPHABETICAL CHARACTERS. That means that "abc;def", has two words: "abc"
and "def". The separating character does not have to be whitespace, and
there could be more than one separating character between two words.
A simple example: given the string "test string test", there are three
words, "test", "string", and "test". The first letters of each word come
together to form the string "tst". And since "tst" is a palindrome, this
function should return True for the input "test string test".
Precondition: <string> will contain at least one word.
"""
Trending now
This is a popular solution!
Step by step
Solved in 2 steps