Exercise · Strings and Arrays · lesson 5 of 6
Exercise: palindrome
Write a function bool is_palindrome(std::string_view s). It returns true if s is a palindrome, a string that reads the same in both directions, and false otherwise.
is_palindrome("abba")→trueis_palindrome("level")→trueis_palindrome("abca")→false
Constraints: letter case matters, so "Abba" is not a palindrome; an empty string and a one-character string are palindromes.