DIY: Valid Palindrome

Solve the interview question "Valid Palindrome" in this lesson.

Problem statement

Write a function that takes a variable containing a string, and check whether it is a palindrome or not.


The input will contain a string s. The following two are example inputs to the function:



The output will be a Boolean representing whether the string is palindrome or not. For the above two inputs, the outputs will be:


Coding exercise

Implement the isPalindrome(s) function, where s is the string. The function returns true or false depending on whether the string is palindrome or not

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.