Cody

Solution 1952477

Submitted on 29 Sep 2019 by Khanh Le Quang
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))

a = 1 var2 = 1 y = 1

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

a = 12 var2 = 12 y = 0 0 0 0 0 0 0 0 0 0 0 -10 var2 = 11 y = 0 0 0 0 0 0 0 0 0 0 -9 -10 var2 = 10 y = 0 0 0 0 0 0 0 0 0 -8 -9 -10 var2 = 9 y = 0 0 0 0 0 0 0 0 -7 -8 -9 -10 var2 = 8 y = 0 0 0 0 0 0 0 -6 -7 -8 -9 -10 var2 = 7 y = 0 0 0 0 0 0 -5 -6 -7 -8 -9 -10 var2 = 6 y = 0 0 0 0 0 -4 -5 -6 -7 -8 -9 -10 var2 = 5 y = 0 0 0 0 -3 -4 -5 -6 -7 -8 -9 -10 var2 = 4 y = 0 0 0 -2 -3 -4 -5 -6 -7 -8 -9 -10 var2 = 3 y = 0 0 -1 -2 -3 -4 -5 -6 -7 -8 -9 -10 var2 = 2 y = 0 0 -1 -2 -3 -4 -5 -6 -7 -8 -9 -10 var2 = 1 y = 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))

a = 25 var2 = 25 y = ' a' var2 = 24 y = ' ba' var2 = 23 y = ' lba' var2 = 22 y = ' elba' var2 = 21 y = ' elba' var2 = 20 y = ' w elba' var2 = 19 y = ' aw elba' var2 = 18 y = ' saw elba' var2 = 17 y = ' saw elba' var2 = 16 y = ' i saw elba' var2 = 15 y = ' i saw elba' var2 = 14 y = ' e i saw elba' var2 = 13 y = ' re i saw elba' var2 = 12 y = ' ere i saw elba' var2 = 11 y = ' ere i saw elba' var2 = 10 y = ' i ere i saw elba' var2 = 9 y = ' i ere i saw elba' var2 = 8 y = ' s i ere i saw elba' var2 = 7 y = ' as i ere i saw elba' var2 = 6 y = ' was i ere i saw elba' var2 = 5 y = ' was i ere i saw elba' var2 = 4 y = ' e was i ere i saw elba' var2 = 3 y = ' le was i ere i saw elba' var2 = 2 y = ' ble was i ere i saw elba' var2 = 1 y = 'able was i ere i saw elba'

Suggested Problems

More from this Author1