Cody

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

Solution 927619

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

sentences = Columns 1 through 3 'I am having a gre…' ' The camp counsel…' ' Monday we went k…' Columns 4 through 5 ' Archery was grea…' ' -Love Johnny' s = I am having a great time at summer camp g = 15 s = The camp counselors are great and the activities are great g = 26 55 s = The camp counselors are great and the activities are zzzzz s = The camp counselors are great and the activities are awesome sentences = Columns 1 through 3 'I am having a gre…' ' The camp counsel…' ' Monday we went k…' Columns 4 through 5 ' Archery was grea…' ' -Love Johnny' s = Monday we went kayaking and Tuesday we learned archery g = [] s = Archery was great and I hit the bull's eye which everyone was said was really great g = 14 80 s = Archery was great and I hit the bull's eye which everyone was said was really zzzzz s = Archery was great and I hit the bull's eye which everyone was said was really awesome sentences = Columns 1 through 3 'I am having a gre…' ' The camp counsel…' ' Monday we went k…' Columns 4 through 5 ' Archery was grea…' ' -Love Johnny' s = -Love Johnny g = [] 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))

sentences = 'This sentence has great twice, which is g…' '' s = This sentence has great twice, which is great g = 19 41 s = This sentence has great twice, which is zzzzz s = This sentence has great twice, which is awesome sentences = 'This sentence has great twice, which is a…' '' s = '' g = [] 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))

sentences = 'Summer camp this …' ' I will treasure …' ' It was truly an …' '' s = Summer camp this year has been so great and I have made so many great friends g = 35 65 s = Summer camp this year has been so great and I have made so many zzzzz friends s = Summer camp this year has been so great and I have made so many awesome friends sentences = 'Summer camp this …' ' I will treasure …' ' It was truly an …' '' s = I will treasure the great memories and great times forever g = 22 41 s = I will treasure the great memories and zzzzz times forever s = I will treasure the great memories and awesome times forever sentences = 'Summer camp this …' ' I will treasure …' ' It was truly an …' '' s = It was truly an awesome time g = [] s = '' g = [] 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.

Suggested Problems

More from this Author3

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!