Welcome to WordPress. This is your first post. Edit or delete it, then start writing!
s = "malayalam" # string
i,j = 0, len(s) - 1 # two pointers
is_palindrome = True # assume palindrome
while i < j:
if s[i] != s[j]: # mismatch found
is_palindrome = False
break
i += 1
j -= 1
if is_palindrome:
print("Yes")
else:
print("No")
Hi, this is a comment.
To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard.
Commenter avatars come from Gravatar.