Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Hello, these are codingbat problems for java so google for solutions if needed, but I want them translated into c++. I tried doing this myself
Hello, these are codingbat problems for java so google for solutions if needed, but I want them translated into c++. I tried doing this myself but the output does not match the sample outputs so please help thank you.
1 THE WORD ENDS PROBLEM Given a string and a non-empty word string, set result to a string made of each char just before and just after every appearance of the word in the string. Ignore cases where there is no char before or after the word, and a char may be included twice if it is between two words. Do not do any printing. for input of "abcXY123XYijk", "X" for input of "XY123XY", "XY""13 for input of "XY1xy", "xY""11" "c13i" 2 THE PLUS OUT PROBLEM Given a string and a non-empty word string, set result to a version of the original string where all chars have been replaced by pluses ("+"), except for appearances of the word string which are preserved unchanged. for input of "12xy34", "Xy", "++xy++" . for input of "12xy34", "1" -"1+ . for input of "12xy34xyabcxy", "xy" "++xy++xy xyStep 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