Functions and string logic

A palindrome reads the same forwards and backwards.

Write a function that returns true if a string is a palindrome, false otherwise. Print the result.

Input:  racecar
Output: true

Input:  hello
Output: false

Constraints

  • Case insensitive: "Racecar" should return true.
  • Ignore non-alphanumeric characters: "A man a plan a canal Panama" → true.
Ad SpaceGoogle AdSense active for guests & free-tier learners.