Skip to content

Latest commit

 

History

History
28 lines (18 loc) · 883 Bytes

File metadata and controls

28 lines (18 loc) · 883 Bytes

Check Palindrome

CodeSignal

Question Description. Link

Given the string, check if it is a palindrome.

  • Palindrome

    A string that doesn't change when reversed (it reads the same backward and forward).

    • "eye" is a palindrome
    • "noon" is a palindrome
    • "decaf faced" is a palindrome
    • "taco cat" is not a palindrome (backwards it spells "tac ocat")
    • "racecars" is not a palindrome (backwards it spells "sracecar")

Example

  • For inputString = "aabaa", the output should be checkPalindrome(inputString) = true
  • For inputString = "abac", the output should be checkPalindrome(inputString) = false
  • For inputString = "a", the output should be checkPalindrome(inputString) = true

Solutions