Cody

Solution 1975161

Submitted on 14 Oct 2019 by Joseph Chambers
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))

b = logical 0 ans = 3 i = 1 ans = 2 i = 2 ans = 3 i = 3 ans = 4

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

b = logical 0 ans = 11 i = 1 ans = 20 i = 2 ans = 21 i = 3 ans = 22 i = 4 ans = 23 i = 5 ans = 24 i = 6 ans = 25 i = 7 ans = 26 i = 8 ans = 27 i = 9 ans = 28 i = 10 ans = 29 i = 11 ans = 30

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

b = logical 0 ans = 1 i = 1 ans = 1

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

b = logical 0 ans = 6 i = 1 ans = 6 i = 2 ans = 10 i = 3 ans = 12 i = 4 ans = 14 i = 5 ans = 36 i = 6 ans = 101

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

b = logical 0 ans = 5 i = 1 ans = 6 i = 2 ans = 10 i = 3 ans = 12 i = 4 ans = 14 i = 5 ans = 101

Suggested Problems

More from this Author95