Cody

Solution 2212876

Submitted on 15 Apr 2020 by Brian Kelley
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 = [2 3 4]; assert(isequal(isItSquared(a),true))

rs = 1 cs = 3 ismember = 2 ismember = 4 out = logical 1 b = logical 1 b = logical 1

2   Pass
a = [20:30]; assert(isequal(isItSquared(a),false))

rs = 1 cs = 11 ismember = 20 ismember = 400 out = logical 0 b = logical 0 ismember = 21 ismember = 441 out = logical 0 b = logical 0 ismember = 22 ismember = 484 out = logical 0 b = logical 0 ismember = 23 ismember = 529 out = logical 0 b = logical 0 ismember = 24 ismember = 576 out = logical 0 b = logical 0 ismember = 25 ismember = 625 out = logical 0 b = logical 0 ismember = 26 ismember = 676 out = logical 0 b = logical 0 ismember = 27 ismember = 729 out = logical 0 b = logical 0 ismember = 28 ismember = 784 out = logical 0 b = logical 0 ismember = 29 ismember = 841 out = logical 0 b = logical 0 ismember = 30 ismember = 900 out = logical 0 b = logical 0

3   Pass
a = [1]; assert(isequal(isItSquared(a),true))

rs = 1 cs = 1 ismember = 1 ismember = 1 out = logical 1 b = logical 1 b = logical 1

4   Pass
a = [6 10 12 14 36 101]; assert(isequal(isItSquared(a),true))

rs = 1 cs = 6 ismember = 6 ismember = 36 out = logical 1 b = logical 1 b = logical 1

5   Pass
a = [6 10 12 14 101]; assert(isequal(isItSquared(a),false))

rs = 1 cs = 5 ismember = 6 ismember = 36 out = logical 0 b = logical 0 ismember = 10 ismember = 100 out = logical 0 b = logical 0 ismember = 12 ismember = 144 out = logical 0 b = logical 0 ismember = 14 ismember = 196 out = logical 0 b = logical 0 ismember = 101 ismember = 10201 out = logical 0 b = logical 0