Cody

# Problem 233. Reverse the vector

Solution 1942182

Submitted on 19 Sep 2019 by Manasa Kavuru
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 = 1; y_correct = 1; assert(isequal(reverseVector(x),y_correct))

k = 1 y = 1 k = 0

2   Pass
x = -10:1; y_correct = 1:-1:-10; assert(isequal(reverseVector(x),y_correct))

k = 12 y = 1 k = 11 y = 1 0 k = 10 y = 1 0 -1 k = 9 y = 1 0 -1 -2 k = 8 y = 1 0 -1 -2 -3 k = 7 y = 1 0 -1 -2 -3 -4 k = 6 y = 1 0 -1 -2 -3 -4 -5 k = 5 y = 1 0 -1 -2 -3 -4 -5 -6 k = 4 y = 1 0 -1 -2 -3 -4 -5 -6 -7 k = 3 y = 1 0 -1 -2 -3 -4 -5 -6 -7 -8 k = 2 y = 1 0 -1 -2 -3 -4 -5 -6 -7 -8 -9 k = 1 y = 1 0 -1 -2 -3 -4 -5 -6 -7 -8 -9 -10 k = 0

3   Pass
x = 'able was i ere i saw elba'; y_correct = 'able was i ere i saw elba'; assert(isequal(reverseVector(x),y_correct))

k = 25 y = 'a' k = 24 y = 'ab' k = 23 y = 'abl' k = 22 y = 'able' k = 21 y = 'able ' k = 20 y = 'able w' k = 19 y = 'able wa' k = 18 y = 'able was' k = 17 y = 'able was ' k = 16 y = 'able was i' k = 15 y = 'able was i ' k = 14 y = 'able was i e' k = 13 y = 'able was i er' k = 12 y = 'able was i ere' k = 11 y = 'able was i ere ' k = 10 y = 'able was i ere i' k = 9 y = 'able was i ere i ' k = 8 y = 'able was i ere i s' k = 7 y = 'able was i ere i sa' k = 6 y = 'able was i ere i saw' k = 5 y = 'able was i ere i saw ' k = 4 y = 'able was i ere i saw e' k = 3 y = 'able was i ere i saw el' k = 2 y = 'able was i ere i saw elb' k = 1 y = 'able was i ere i saw elba' k = 0