i am surprised to see why the same thing doesn't work when kept in decimal
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
x = 0.63;
y_correct = [1 0 1 0 1 1];
assert(isequal(coins(x),y_correct))
y =
1
x =
13
y =
1 0
x =
13
y =
1 0 1
x =
3
y =
1 0 1 0
x =
3
y =
1 0 1 0 1
x =
1
y =
1 0 1 0 1 1
x =
0
|
2 | Pass |
x = 0.49;
y_correct = [0 2 0 1 2 0];
assert(isequal(coins(x),y_correct))
y =
0
x =
49
y =
0 2
x =
9
y =
0 2 0
x =
9
y =
0 2 0 1
x =
4
y =
0 2 0 1 2
x =
0
y =
0 2 0 1 2 0
x =
0
|
926 Solvers
2810 Solvers
187 Solvers
The sum of the numbers in the vector
426 Solvers
Matrix multiplication across rows
176 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!