Cody

Solution 2393549

Submitted on 27 May 2020 by Nikolaos Nikolaou
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
a = 1; y_correct = 2; assert(isequal(zero_and(a),y_correct))

t1 = 1 b = 2

2   Pass
a = 2; y_correct = 1; assert(isequal(zero_and(a),y_correct))

t1 = 1 0 b = 1

3   Pass
a = 12; y_correct = 1; assert(isequal(zero_and(a),y_correct))

t1 = 1 1 0 0 b = 1

4   Pass
a = 11; y_correct = 4; assert(isequal(zero_and(a),y_correct))

t1 = 1 0 1 1 b = 4

5   Pass
a = 15; y_correct = 16; assert(isequal(zero_and(a),y_correct))

t1 = 1 1 1 1 b = 16

6   Pass
a = 23; y_correct = 8; assert(isequal(zero_and(a),y_correct))

t1 = 1 0 1 1 1 b = 8

7   Pass
a = 93; y_correct = 2; assert(isequal(zero_and(a),y_correct))

t1 = 1 0 1 1 1 0 1 b = 2

8   Pass
a = 1455; y_correct = 16; assert(isequal(zero_and(a),y_correct))

t1 = 1 0 1 1 0 1 0 1 1 1 1 b = 16

9   Pass
a = 255; y_correct = 256; assert(isequal(zero_and(a),y_correct))

t1 = 1 1 1 1 1 1 1 1 b = 256

10   Pass
a = 435175; y_correct = 8; assert(isequal(zero_and(a),y_correct))

t1 = 1 1 0 1 0 1 0 0 0 1 1 1 1 1 0 0 1 1 1 b = 1048 b = 8

11   Pass
filetext = fileread('zero_and.m'); assert(isempty(strfind(filetext, 'regexp')),'regexp() forbidden') assert(isempty(strfind(filetext, 'varargin')),'varargin() forbidden')

Suggested Problems

More from this Author145