Question: 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 xy
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
