1_palindrome
- Source name
- 1_palindrome.py
# # Checking for a palindrome efficiently
# T.C. : O(n)
def isPalindrome(s):
return s == s[::-1]
string = "madam"
print(isPalindrome(string))# # Checking for a palindrome efficiently
# T.C. : O(n)
def isPalindrome(s):
return s == s[::-1]
string = "madam"
print(isPalindrome(string))