Cody

Problem 2500. Text Processing - New

Solution 2736157

Submitted on 24 Jul 2020
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   Fail
x = 'Sheldon, Penny, Leonard and Raj are great and great and great and great receptively. Wolowitz is just a great jerk'; y_correct = 'Sheldon, Penny, Leonard and Raj are great and awesome and great and awesome receptively. Wolowitz is just a great jerk'; assert(isequal(stringGreat(x),y_correct))

Unable to use a value of type cell as an index. Error in stringGreat (line 4) w(indx(2:2:end)) = {'awesome'}; Error in Test1 (line 3) assert(isequal(stringGreat(x),y_correct))

2   Fail
x = 'great great great. great great. great' y_correct = 'great awesome great. great awesome. great' assert(isequal(stringGreat(x),y_correct))

x = 'great great great. great great. great' y_correct = 'great awesome great. great awesome. great'

Unable to use a value of type cell as an index. Error in stringGreat (line 4) w(indx(2:2:end)) = {'awesome'}; Error in Test2 (line 3) assert(isequal(stringGreat(x),y_correct))

3   Fail
x = 'Greatness is great gift. Great news' y_correct = x; assert(isequal(stringGreat(x),y_correct))

x = 'Greatness is great gift. Great news'

Unable to use a value of type cell as an index. Error in stringGreat (line 4) w(indx(2:2:end)) = {'awesome'}; Error in Test3 (line 3) assert(isequal(stringGreat(x),y_correct))

4   Fail
x = 'Being great implies that you must think like other great people and that is basically done to make sure that the proverb great minds think alike is correct and that is great. Probably that is not a great example I came up with'; y_correct = 'Being great implies that you must think like other awesome people and that is basically done to make sure that the proverb great minds think alike is correct and that is awesome. Probably that is not a great example I came up with'; assert(isequal(stringGreat(x),y_correct))

Unable to use a value of type cell as an index. Error in stringGreat (line 4) w(indx(2:2:end)) = {'awesome'}; Error in Test4 (line 5) assert(isequal(stringGreat(x),y_correct))

Suggested Problems

More from this Author44

Community Treasure Hunt

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

Start Hunting!