Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
x = 7;
y_correct = [2,3];
assert(isequal(nim(x),y_correct))
A =
30 39 48 1 10 19 28
38 47 7 9 18 27 29
46 6 8 17 26 35 37
5 14 16 25 34 36 45
13 15 24 33 42 44 4
21 23 32 41 43 3 12
22 31 40 49 2 11 20
a =
2
b =
3
y =
2 3
|
2 | Pass |
x = 11;
y_correct = [2,5];
assert(isequal(nim(x),y_correct))
A =
68 81 94 107 120 1 14 27 40 53 66
80 93 106 119 11 13 26 39 52 65 67
92 105 118 10 12 25 38 51 64 77 79
104 117 9 22 24 37 50 63 76 78 91
116 8 21 23 36 49 62 75 88 90 103
7 20 33 35 48 61 74 87 89 102 115
19 32 34 47 60 73 86 99 101 114 6
31 44 46 59 72 85 98 100 113 5 18
43 45 58 71 84 97 110 112 4 17 30
55 57 70 83 96 109 111 3 16 29 42
56 69 82 95 108 121 2 15 28 41 54
a =
2
b =
5
y =
2 5
|
3 | Pass |
x = 3;
y_correct = [2,1];
assert(isequal(nim(x),y_correct))
A =
8 1 6
3 5 7
4 9 2
a =
2
b =
1
y =
2 1
|
Replace NaNs with the number that appears to its left in the row.
2018 Solvers
We love vectorized solutions. Problem 1 : remove the row average.
546 Solvers
Change the sign of even index entries of the reversed vector
296 Solvers
965 Solvers
246 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!