Cody

# Problem 2440. Text processing - Help Johnny write a letter home from camp

Solution 551958

Submitted on 4 Jan 2015 by Abdullah Caliskan
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
%% Test 1 textIn1 = strcat('I am having a great time at summer camp. The camp', ... ' counselors are great and the activities are great. Monday', ... ' we went kayaking and Tuesday we learned archery. Archery was', ... ' great and I hit the bull''s eye which everyone was said was', ... ' really great. -Love Johnny'); textOut1 = strcat('I am having a great time at summer camp. The camp', ... ' counselors are great and the activities are awesome. Monday', ... ' we went kayaking and Tuesday we learned archery. Archery was', ... ' great and I hit the bull''s eye which everyone was said was', ... ' really awesome. -Love Johnny'); assert(strcmp(improve(textIn1),textOut1))

t = I am having a great time at summer camp*The camp counselors are great and the activities are great*Monday we went kayaking and Tuesday we learned archery*Archery was great and I hit the bull's eye which everyone was said was really great*-Love Johnny t = I am having a great time at summer camp*The camp counselors are great and the activities are great*Monday we went kayaking and Tuesday we learned archery*Archery was great and I hit the bull's eye which everyone was said was really great*-Love Johnny* k = '*' '*' '*' '*' '*' p = 40 99 154 238 251 p = 0 40 99 154 238 251 251 N = [] m = I am having a great time at summer camp m = The camp counselors are great and the activities are great m = Monday we went kayaking and Tuesday we learned archery m = Archery was great and I hit the bull's eye which everyone was said was really great m = -Love Johnny m = Empty string: 1-by-0 N = I am having a great time at summer camp. The camp counselors are great and the activities are awesome. Monday we went kayaking and Tuesday we learned archery. Archery was great and I hit the bull's eye which everyone was said was really awesome. -Love Johnny

2   Pass
%% Test 2 textIn2 = strcat('This sentence has great twice, which is great.'); textOut2 = strcat('This sentence has great twice, which is awesome.'); assert(strcmp(improve(textIn2),textOut2))

t = This sentence has great twice, which is great. t = This sentence has great twice, which is great.* k = '*' p = 47 p = 0 47 47 N = [] m = This sentence has great twice, which is great. m = Empty string: 1-by-0 N = This sentence has great twice, which is awesome.

3   Pass
%% Test 3 textIn3 = strcat('Summer camp this year has been so great and I have', ... ' made so many great friends. I will treasure the great memories', ... ' and great times forever. It was truly an awesome time.'); textOut3 = strcat('Summer camp this year has been so great and I have', ... ' made so many awesome friends. I will treasure the great memories', ... ' and awesome times forever. It was truly an awesome time.'); assert(strcmp(improve(textIn3),textOut3))

t = Summer camp this year has been so great and I have made so many great friends*I will treasure the great memories and great times forever*It was truly an awesome time. t = Summer camp this year has been so great and I have made so many great friends*I will treasure the great memories and great times forever*It was truly an awesome time.* k = '*' '*' '*' p = 78 137 167 p = 0 78 137 167 167 N = [] m = Summer camp this year has been so great and I have made so many great friends m = I will treasure the great memories and great times forever m = It was truly an awesome time. m = Empty string: 1-by-0 N = Summer camp this year has been so great and I have made so many awesome friends. I will treasure the great memories and awesome times forever. It was truly an awesome time.