Cody

# Problem 233. Reverse the vector

Solution 2172194

Submitted on 24 Mar 2020 by Simon Hönes
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))

z = 1 y = 1 vec = [] vec = 1

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

z = 1 y = 12 vec = [] vec = 1 vec = 1 0 vec = 1 0 -1 vec = 1 0 -1 -2 vec = 1 0 -1 -2 -3 vec = 1 0 -1 -2 -3 -4 vec = 1 0 -1 -2 -3 -4 -5 vec = 1 0 -1 -2 -3 -4 -5 -6 vec = 1 0 -1 -2 -3 -4 -5 -6 -7 vec = 1 0 -1 -2 -3 -4 -5 -6 -7 -8 vec = 1 0 -1 -2 -3 -4 -5 -6 -7 -8 -9 vec = 1 0 -1 -2 -3 -4 -5 -6 -7 -8 -9 -10

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

z = 1 y = 25 vec = [] vec = 'a' vec = 'ab' vec = 'abl' vec = 'able' vec = 'able ' vec = 'able w' vec = 'able wa' vec = 'able was' vec = 'able was ' vec = 'able was i' vec = 'able was i ' vec = 'able was i e' vec = 'able was i er' vec = 'able was i ere' vec = 'able was i ere ' vec = 'able was i ere i' vec = 'able was i ere i ' vec = 'able was i ere i s' vec = 'able was i ere i sa' vec = 'able was i ere i saw' vec = 'able was i ere i saw ' vec = 'able was i ere i saw e' vec = 'able was i ere i saw el' vec = 'able was i ere i saw elb' vec = 'able was i ere i saw elba'