Cody

Problem 2161. Let's get back to school, and create multiplication tables

Solution 1818682

Submitted on 17 May 2019
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
start = 1; endno = 10; y_correct = [1 2 3 4 5 6 7 8 9 10; 2 4 6 8 10 12 14 16 18 20; 3 6 9 12 15 18 21 24 27 30; 4 8 12 16 20 24 28 32 36 40; 5 10 15 20 25 30 35 40 45 50; 6 12 18 24 30 36 42 48 54 60; 7 14 21 28 35 42 49 56 63 70; 8 16 24 32 40 48 56 64 72 80; 9 18 27 36 45 54 63 72 81 90; 10 20 30 40 50 60 70 80 90 100;]; assert(isequal(Tables(start, endno),y_correct))

table = 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 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 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 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 1 2 3 4 5 6 7 8 9 10 2 4 6 8 10 12 14 16 18 20 3 6 9 12 15 18 21 24 27 30 4 8 12 16 20 24 28 32 36 40 5 10 15 20 25 30 35 40 45 50 6 12 18 24 30 36 42 48 54 60 7 14 21 28 35 42 49 56 63 70 8 16 24 32 40 48 56 64 72 80 9 18 27 36 45 54 63 72 81 90 10 20 30 40 50 60 70 80 90 100

2   Fail
start = 17; endno = 19; y_correct = [17 18 19; 34 36 38; 51 54 57; 68 72 76; 85 90 95; 102 108 114; 119 126 133; 136 144 152; 153 162 171; 170 180 190;]; assert(isequal(Tables(start, endno),y_correct))

table = 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 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 17 18 19 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 34 36 38 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 51 54 57 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 68 72 76 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 85 90 95 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 102 108 114 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 119 126 133 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 136 144 152 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 153 162 171 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 170 180 190

Assertion failed.

3   Fail
start = 21; endno = 22; y_correct =[21 22; 42 44; 63 66; 84 88; 105 110; 126 132; 147 154; 168 176; 189 198; 210 220;] assert(isequal(Tables(start, endno),y_correct))

y_correct = 21 22 42 44 63 66 84 88 105 110 126 132 147 154 168 176 189 198 210 220 table = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 21 22 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 42 44 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 63 66 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 84 88 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 105 110 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 126 132 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 147 154 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 168 176 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 189 198 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 210 220

Assertion failed.