/* Write a short recursive C++ function that determines if a string s is a palindrome, that is, it is equal to its rever
Posted: Tue Jul 12, 2022 8:15 am
/*Write a short recursive C++ function that determines if a string sis apalindrome, that is, it is equal to its reverse. For example,"racecar"and "gohangasalamiimalasagnahog" are palindromes.*/#include <iostream>#include <string>bool isPalinHelper(std::string& s, int begin, int end) {// Your code here}bool isPalin(std::string& s) {return isPalinHelper(s, 0, s.size()-1);}int main() {std::string s1{"racecar"}; // Palindromeif (isPalin(s1)) std::cout << s1 << " is a palindrome"<< std::endl;else std::cout << s1 << " is not a palindrome" <<std:: endl;std::string s2{"racecars"}; // Not a palindromeif (isPalin(s2)) std::cout << s2 << " is a palindrome"<< std::endl;else std::cout << s2 << " is not a palindrome" <<std:: endl;std::string s3{"gohangasalamiimalasagnahog"};if (isPalin(s3)) std::cout << s3 << " is a palindrome"<< std::endl;else std::cout << s3 << " is not a palindrome" <<std:: endl;}