Cody

# Problem 171. Reverse the Words (not letters) of a String

Solution 1983304

Submitted on 20 Oct 2019 by Shiv010
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
x = 'Will the ecological jail rule outside the tear'; y_correct = 'tear the outside rule jail ecological the Will'; assert(isequal(reverseWords(x),y_correct))

cc = 'tear the outside rule jail ecological the Will ' cc = 'tear the outside rule jail ecological the Will' y = 5 9 10 18 19 24 25 30 31 42 43 47 gg = [] nn = 4 nn = 1 gg = 9 nn = 8 nn = 1 gg = 9 18 nn = 5 nn = 1 gg = 9 18 24 nn = 5 nn = 1 gg = 9 18 24 30 nn = 11 nn = 1 gg = 9 18 24 30 42 nn = 4 cc = 'tear the outside rule jail ecological the Will' s2 = 'tear the outside rule jail ecological the Will'

2   Pass
x = 'That computer programmer kept the room warm'; y_correct = 'warm room the kept programmer computer That'; assert(isequal(reverseWords(x),y_correct))

cc = 'warm room the kept programmer computer That ' cc = 'warm room the kept programmer computer That' y = 5 10 11 15 16 21 22 33 34 43 gg = [] nn = 5 nn = 1 gg = 10 nn = 4 nn = 1 gg = 10 15 nn = 5 nn = 1 gg = 10 15 21 nn = 11 nn = 1 gg = 10 15 21 33 nn = 9 cc = 'warm room the kept programmer computer That' s2 = 'warm room the kept programmer computer That'

3   Pass
x = 'trivial'; y_correct = 'trivial'; assert(isequal(reverseWords(x),y_correct))

s2 = 'trivial'