Cody

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

Solution 927650

Submitted on 26 Jul 2016 by Stephanie O'Neil
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
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))

greats = 15 66 95 170 236 send = 40 100 156 241 ins = 1 3 3 5 toomany = 1 2 0 2 change = 95 236 textOut = I am having a great time at summer camp. The camp counselors are great and the activities are zzzzz. 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 zzzzz. -Love Johnny textOut = 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
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))

greats = 19 41 send = 46 ins = 2 toomany = 2 change = 41 textOut = This sentence has great twice, which is zzzzz. textOut = This sentence has great twice, which is awesome.

3   Pass
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))

greats = 35 65 100 119 send = 78 138 168 ins = 2 4 4 toomany = 2 2 0 change = 65 119 textOut = Summer camp this year has been so great and I have made so many zzzzz friends. I will treasure the great memories and zzzzz times forever. It was truly an awesome time. textOut = 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.