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 solutionsif needed, but I want them translated into c++. I tried doing

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

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!