Cody

# Problem 23. Finding Perfect Squares

Solution 2062778

Submitted on 18 Dec 2019 by Alistair James
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))

n = 3 b = logical 0 Sqr = 4 j = 1 b = logical 1

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

n = 11 b = logical 0 Sqr = 400 j = 1 Sqr = 441 j = 1 Sqr = 484 j = 1 Sqr = 529 j = 1 Sqr = 576 j = 1 Sqr = 625 j = 1 Sqr = 676 j = 1 Sqr = 729 j = 1 Sqr = 784 j = 1 Sqr = 841 j = 1 Sqr = 900 j = 1

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

n = 1 b = logical 0 Sqr = 1 j = 1 b = logical 1

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

n = 6 b = logical 0 Sqr = 36 j = 1 b = logical 1

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

n = 5 b = logical 0 Sqr = 36 j = 1 Sqr = 100 j = 1 Sqr = 144 j = 1 Sqr = 196 j = 1 Sqr = 10201 j = 1