DIY: Valid Palindrome

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

Problem statement

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

Input

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

"bccd"
"abcab"

Output

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

true
false

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