Cody

# Problem 23. Finding Perfect Squares

Solution 1855321

Submitted on 21 Jun 2019 by Alejandro Garcia Ruiz
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 = 2 m = 2 m = 3 m = 4 b = logical 1

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

n = 20 m = 20 m = 21 m = 22 m = 23 m = 24 m = 25 m = 26 m = 27 m = 28 m = 29 m = 30 b = logical 0 n = 21 m = 20 m = 21 m = 22 m = 23 m = 24 m = 25 m = 26 m = 27 m = 28 m = 29 m = 30 b = logical 0 n = 22 m = 20 m = 21 m = 22 m = 23 m = 24 m = 25 m = 26 m = 27 m = 28 m = 29 m = 30 b = logical 0 n = 23 m = 20 m = 21 m = 22 m = 23 m = 24 m = 25 m = 26 m = 27 m = 28 m = 29 m = 30 b = logical 0 n = 24 m = 20 m = 21 m = 22 m = 23 m = 24 m = 25 m = 26 m = 27 m = 28 m = 29 m = 30 b = logical 0 n = 25 m = 20 m = 21 m = 22 m = 23 m = 24 m = 25 m = 26 m = 27 m = 28 m = 29 m = 30 b = logical 0 n = 26 m = 20 m = 21 m = 22 m = 23 m = 24 m = 25 m = 26 m = 27 m = 28 m = 29 m = 30 b = logical 0 n = 27 m = 20 m = 21 m = 22 m = 23 m = 24 m = 25 m = 26 m = 27 m = 28 m = 29 m = 30 b = logical 0 n = 28 m = 20 m = 21 m = 22 m = 23 m = 24 m = 25 m = 26 m = 27 m = 28 m = 29 m = 30 b = logical 0 n = 29 m = 20 m = 21 m = 22 m = 23 m = 24 m = 25 m = 26 m = 27 m = 28 m = 29 m = 30 b = logical 0 n = 30 m = 20 m = 21 m = 22 m = 23 m = 24 m = 25 m = 26 m = 27 m = 28 m = 29 m = 30 b = logical 0

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

n = 1 m = 1 b = logical 1

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

n = 6 m = 6 m = 10 m = 12 m = 14 m = 36 b = logical 1

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

n = 6 m = 6 m = 10 m = 12 m = 14 m = 101 b = logical 0 n = 10 m = 6 m = 10 m = 12 m = 14 m = 101 b = logical 0 n = 12 m = 6 m = 10 m = 12 m = 14 m = 101 b = logical 0 n = 14 m = 6 m = 10 m = 12 m = 14 m = 101 b = logical 0 n = 101 m = 6 m = 10 m = 12 m = 14 m = 101 b = logical 0