Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
%%
x = 1;
y_correct = 3;
assert(isequal(Nth_polite(x),y_correct))
ans =
2
ans =
3
|
2 | Pass |
%%
x = 2;
y_correct = 5;
assert(isequal(Nth_polite(x),y_correct))
ans =
3
ans =
5
|
3 | Pass |
%%
x = 4;
y_correct = 7;
assert(isequal(Nth_polite(x),y_correct))
ans =
5
ans =
7
|
4 | Pass |
%%
x = 5;
y_correct = 9;
assert(isequal(Nth_polite(x),y_correct))
ans =
6
ans =
9
|
5 | Pass |
%%
x = 7;
y_correct = 11;
assert(isequal(Nth_polite(x),y_correct))
ans =
8
ans =
11
|
6 | Pass |
%%
x = 11;
y_correct = 15;
assert(isequal(Nth_polite(x),y_correct))
ans =
12
ans =
15
|
7 | Pass |
%%
x = 12;
y_correct = 17;
assert(isequal(Nth_polite(x),y_correct))
ans =
13
ans =
17
|
8 | Pass |
%%
x = 14;
y_correct = 19;
assert(isequal(Nth_polite(x),y_correct))
ans =
15
ans =
19
|
9 | Pass |
%%
x = 19;
y_correct = 24;
assert(isequal(Nth_polite(x),y_correct))
ans =
20
ans =
24
|
10 | Pass |
%%
x = 21;
y_correct = 26;
assert(isequal(Nth_polite(x),y_correct))
ans =
22
ans =
26
|
11 | Pass |
%%
x = 27;
y_correct = 33;
assert(isequal(Nth_polite(x),y_correct))
ans =
28
ans =
33
|
12 | Pass |
%%
x = 64;
y_correct = 71;
assert(isequal(Nth_polite(x),y_correct))
ans =
65
ans =
71
|
13 | Pass |
%%
x = 1e6;
y_correct = x+20;
assert(isequal(Nth_polite(x),y_correct))
ans =
1000001
ans =
1000020
|
14 | Pass |
%%
x = 1e7;
y_correct = x+24;
assert(isequal(Nth_polite(x),y_correct))
ans =
10000001
ans =
10000024
|
15 | Pass |
%%
x = 999999999;
y_correct = x+30;
assert(isequal(Nth_polite(x),y_correct))
ans =
1.0000e+09
ans =
1.0000e+09
|
What is the next step in Conway's Life?
640 Solvers
381 Solvers
Make one big string out of two smaller strings
1149 Solvers
185 Solvers
Create a matrix X, where each column is a shifted copy of the vector v
142 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!