Hello world!

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")   

1 thought on “Hello world!”

Leave a Comment

Your email address will not be published. Required fields are marked *