Question
write a C++ program Given a string, you need to determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. That is,
write a C++ program
Given a string, you need to determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. That is, you need to ignore all characters such as punctuation and spaces. Note: there is a function in C++ standard library called tolower which can be handy. Also you can use another C/C++ function isalnum. In general, try to use standard functions instead of reinventing the wheel.. You need to implement a function that takes a string as input and return true/false. Note: For the purpose of this problem, we define empty string as valid palindrome. For example, Input: A man, a plan, a canal: Panama Output: true Another example: Input: race a car Output: false Check out the starter code for the function signature.
starter code
//
// ValidPalindrome.cpp
//
//
// Created by Yufeng Wu on 1/18/21.
//
//
#include
#include
using namespace std;
// Function to test if the input string is a valid palindrome
// Note: only consider alphanumeric symbols and ignore cases
bool IsValidPalindrome(const string &strInput)
{
// your code go here ...
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started