Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem (5) [10 points] Write a cut function (in C++). This function should take as input two strings, one is the original string to be
Problem (5) [10 points] Write a "cut" function (in C++). This function should take as input two strings, one is the original string to be cut and the other are the words that you want cut. You must remove all the "to cut" parts from the original string, then return this modified string. If the "to cut" part never happens in the original string, you should just return the original string. Note: you should only remove parts from the original string and not recurively from every generated string, see the example for clarification. You can also assume the to cut will not overlap with itself, as inthe case where: original-teelehe. to Cut="chee" original-"IaateteMMate" toCut="ate" returned string-"IateMM" (as "ate" only directly appears twice in the original string)
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