Cody

Solution 297869

Submitted on 7 Aug 2013 by Khizar
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

This solution is outdated. To rescore this solution, sign in.

Test Suite

Test Status Code Input and Output
1   Pass
%% x = 1; y_correct = 1; assert(isequal(reverse(x),y_correct))

n = 1 y = 1 n = 0

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

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

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

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

Suggested Problems

More from this Author1