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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!