Check if a String is a Palindrome

You are given a lowercase string as an argument. Return true if the string is a palindrome, false if it is not.

Palindromes are strings that form the same word if it is reversed.


  • Must return true or false
  • Special characters should be considered part of the string
  • Must account for spaces

Example #1

> true

Example #2

> false

Example #3

solve("ab ba")
> true

Example #4

solve("race car")
> false