Cody

# Problem 23. Finding Perfect Squares

Solution 56987

Submitted on 5 Mar 2012
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 = 2 3 4 B = 3 4

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

B = Columns 1 through 10 20 21 22 23 24 25 26 27 28 29 Column 11 30 B = 21 22 23 24 25 26 27 28 29 30 B = Columns 1 through 10 20 21 22 23 24 25 26 27 28 29 Column 11 30 B = 20 22 23 24 25 26 27 28 29 30 B = Columns 1 through 10 20 21 22 23 24 25 26 27 28 29 Column 11 30 B = 20 21 23 24 25 26 27 28 29 30 B = Columns 1 through 10 20 21 22 23 24 25 26 27 28 29 Column 11 30 B = 20 21 22 24 25 26 27 28 29 30 B = Columns 1 through 10 20 21 22 23 24 25 26 27 28 29 Column 11 30 B = 20 21 22 23 25 26 27 28 29 30 B = Columns 1 through 10 20 21 22 23 24 25 26 27 28 29 Column 11 30 B = 20 21 22 23 24 26 27 28 29 30 B = Columns 1 through 10 20 21 22 23 24 25 26 27 28 29 Column 11 30 B = 20 21 22 23 24 25 27 28 29 30 B = Columns 1 through 10 20 21 22 23 24 25 26 27 28 29 Column 11 30 B = 20 21 22 23 24 25 26 28 29 30 B = Columns 1 through 10 20 21 22 23 24 25 26 27 28 29 Column 11 30 B = 20 21 22 23 24 25 26 27 29 30 B = Columns 1 through 10 20 21 22 23 24 25 26 27 28 29 Column 11 30 B = 20 21 22 23 24 25 26 27 28 30 B = Columns 1 through 10 20 21 22 23 24 25 26 27 28 29 Column 11 30 B = 20 21 22 23 24 25 26 27 28 29

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

Error: Assertion failed.

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

B = 6 10 12 14 36 101 B = 10 12 14 36 101

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

B = 6 10 12 14 101 B = 10 12 14 101 B = 6 10 12 14 101 B = 6 12 14 101 B = 6 10 12 14 101 B = 6 10 14 101 B = 6 10 12 14 101 B = 6 10 12 101 B = 6 10 12 14 101 B = 6 10 12 14