Test  Status  Code Input and Output 

1  Fail 
filetext = fileread('regular.m');
assert(isempty(strfind(filetext, 'for')))
assert(isempty(strfind(filetext, 'while')))

2  Fail 
A = 1;
B = 1;
assert(isequal(regular(A),B));
t =
0 0 0 0 1 0
t =
0 0 1 0 0 0
t =
0 1 0 0 0 1
t =
1 1 0 0 1 0
t =
0 0 1 1 0 0
t =
1 0 0 1 1 0
t =
1 1 0 1 0 0
t =
0 0 0 0 1 0
t =
1 0 0 1 0 1
t =
0 0 1 1 1 1
prob =
0.1667
0.1667
0.3333
0.5000
0.3333
0.5000
0.5000
0.1667
0.5000
0.6667

3  Fail 
A = [2 6
5 3
5 6
3 7];
B = [1 2
3 1
3 2
2 3];
assert(isequal(regular(A),B));
t =
0 0 1 1 1 1
t =
0 0 0 0 0 1
t =
0 1 0 1 0 0
t =
0 1 0 1 0 0
t =
0 0 1 0 1 1
t =
1 0 0 0 0 1
t =
1 1 1 1 0 1
t =
1 0 0 0 0 1
t =
1 0 1 0 0 0
t =
0 0 0 1 0 1
prob =
0.6667
0.1667
0.3333
0.3333
0.5000
0.3333
0.8333
0.3333
0.3333
0.3333

4  Fail 
A = [10 2 4 4 2
4 5 6 8 1
6 5 10 3 9
9 9 5 5 5
9 10 3 7 8];
B = [4 1 2 2 2
1 2 4 5 1
2 2 5 1 5
3 3 3 3 3
3 4 1 4 4];
assert(isequal(regular(A),B));
t =
0 1 1 0 0 1
t =
1 0 0 1 0 0
t =
0 0 0 1 1 0
t =
1 0 0 1 1 1
t =
0 0 1 1 0 1
t =
0 0 0 0 0 0
t =
1 0 0 0 0 0
t =
0 0 0 0 0 1
t =
1 1 0 1 1 0
t =
1 1 0 0 0 0
prob =
0.5000
0.3333
0.3333
0.6667
0.5000
0
0.1667
0.1667
0.6667
0.3333

5  Fail 
A = randi(100,80,100);
B = zeros(size(A));
for iter = 1:size(A,2)
[~, ~, B(:, iter)] = unique(A(:,iter));
end
assert(isequal(regular(A),B));
t =
0 0 1 0 1 1
t =
0 0 0 1 1 0
t =
0 1 1 0 1 1
t =
0 1 1 1 1 0
t =
0 1 0 1 0 0
t =
0 0 1 1 0 1
t =
0 1 0 0 0 0
t =
0 0 0 1 1 0
t =
1 0 1 1 0 0
t =
1 0 1 0 0 0
prob =
0.5000
0.3333
0.6667
0.6667
0.3333
0.5000
0.1667
0.3333
0.5000
0.3333

Remove all the words that end with "ain"
1372 Solvers
Given an unsigned integer x, find the largest y by rearranging the bits in x
717 Solvers
Flag largest magnitude swings as they occur
697 Solvers
Without the French accent please!
105 Solvers
57 Solvers