Cody

# Problem 11. Back and Forth Rows

Solution 924074

Submitted on 16 Jul 2016 by Martin C.
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
n = 5; a = [ 1 2 3 4 5; 10 9 8 7 6; 11 12 13 14 15; 20 19 18 17 16; 21 22 23 24 25]; assert(isequal(a,back_and_forth(n)));

index = 1 b = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 index = 2 b = 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 index = 3 b = 1 2 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 index = 4 b = 1 2 3 4 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 index = 5 b = 1 2 3 4 5 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 index = 6 b = 1 2 3 4 5 1 1 1 1 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 index = 7 b = 1 2 3 4 5 1 1 1 7 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 index = 8 b = 1 2 3 4 5 1 1 8 7 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 index = 9 b = 1 2 3 4 5 1 9 8 7 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 index = 10 b = 1 2 3 4 5 10 9 8 7 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 index = 11 b = 1 2 3 4 5 10 9 8 7 6 11 1 1 1 1 1 1 1 1 1 1 1 1 1 1 index = 12 b = 1 2 3 4 5 10 9 8 7 6 11 12 1 1 1 1 1 1 1 1 1 1 1 1 1 index = 13 b = 1 2 3 4 5 10 9 8 7 6 11 12 13 1 1 1 1 1 1 1 1 1 1 1 1 index = 14 b = 1 2 3 4 5 10 9 8 7 6 11 12 13 14 1 1 1 1 1 1 1 1 1 1 1 index = 15 b = 1 2 3 4 5 10 9 8 7 6 11 12 13 14 15 1 1 1 1 1 1 1 1 1 1 index = 16 b = 1 2 3 4 5 10 9 8 7 6 11 12 13 14 15 1 1 1 1 16 1 1 1 1 1 index = 17 b = 1 2 3 4 5 10 9 8 7 6 11 12 13 14 15 1 1 1 17 16 1 1 1 1 1 index = 18 b = 1 2 3 4 5 10 9 8 7 6 11 12 13 14 15 1 1 18 17 16 1 1 1 1 1 index = 19 b = 1 2 3 4 5 10 9 8 7 6 11 12 13 14 15 1 19 18 17 16 1 1 1 1 1 index = 20 b = 1 2 3 4 5 10 9 8 7 6 11 12 13 14 15 20 19 18 17 16 1 1 1 1 1 index = 21 b = 1 2 3 4 5 10 9 8 7 6 11 12 13 14 15 20 19 18 17 16 21 1 1 1 1 index = 22 b = 1 2 3 4 5 10 9 8 7 6 11 12 13 14 15 20 19 18 17 16 21 22 1 1 1 index = 23 b = 1 2 3 4 5 10 9 8 7 6 11 12 13 14 15 20 19 18 17 16 21 22 23 1 1 index = 24 b = 1 2 3 4 5 10 9 8 7 6 11 12 13 14 15 20 19 18 17 16 21 22 23 24 1 index = 25 b = 1 2 3 4 5 10 9 8 7 6 11 12 13 14 15 20 19 18 17 16 21 22 23 24 25 index = 26 b = 1 2 3 4 5 10 9 8 7 6 11 12 13 14 15 20 19 18 17 16 21 22 23 24 25