Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
x = [0 0 1 1
0 1 -1 -1
2 1 -1 2
2 2 0 0
-1 0 2 1
0 1 0 1];
y_correct = [0 0 0 0
0 0 0 1
0 1 1 -1
2 1 -1 2
2 2 -1 1
-1 1 2 1];
assert(isequal(zerosFirst(x),y_correct))
0 0 0 0
0 0 0 1
0 1 1 -1
2 1 -1 2
2 2 -1 1
-1 1 2 1
|
2 | Pass |
x = [12 56 0 0 65 122 0 37]'
y_correct = [0 0 0 12 56 65 122 37]'
assert(isequal(zerosFirst(x),y_correct))
x =
12
56
0
0
65
122
0
37
y_correct =
0
0
0
12
56
65
122
37
0
0
0
12
56
65
122
37
|
3 | Pass |
filetext = fileread('zerosFirst.m');
assert(isempty(strfind(filetext, 'regexp')),'regexp hacks are forbidden')
|
4 | Pass |
filetext = fileread('zerosFirst.m');
assert(~isempty(strfind(filetext, 'for')),'must use a for loop in solving this problem')
|
5 | Pass |
filetext = fileread('zerosFirst.m');
assert(isempty(strfind(filetext, '!echo')),'!echo hacks are forbidden')
|
Vectorize the digits of an Integer
269 Solvers
Given a window, how many subsets of a vector sum positive
743 Solvers
856 Solvers
We love vectorized solutions. Problem 1 : remove the row average.
546 Solvers
184 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!