Cody

# Problem 23. Finding Perfect Squares

Solution 313702

Submitted on 1 Sep 2013 by Sebastian
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))

i = 1 j = 1 i = 1 j = 2 i = 1 j = 3 b = 1 i = 2 j = 1 i = 2 j = 2 i = 2 j = 3 i = 3 j = 1 i = 3 j = 2 i = 3 j = 3

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

i = 1 j = 1 i = 1 j = 2 i = 1 j = 3 i = 1 j = 4 i = 1 j = 5 i = 1 j = 6 i = 1 j = 7 i = 1 j = 8 i = 1 j = 9 i = 1 j = 10 i = 1 j = 11 i = 2 j = 1 i = 2 j = 2 i = 2 j = 3 i = 2 j = 4 i = 2 j = 5 i = 2 j = 6 i = 2 j = 7 i = 2 j = 8 i = 2 j = 9 i = 2 j = 10 i = 2 j = 11 i = 3 j = 1 i = 3 j = 2 i = 3 j = 3 i = 3 j = 4 i = 3 j = 5 i = 3 j = 6 i = 3 j = 7 i = 3 j = 8 i = 3 j = 9 i = 3 j = 10 i = 3 j = 11 i = 4 j = 1 i = 4 j = 2 i = 4 j = 3 i = 4 j = 4 i = 4 j = 5 i = 4 j = 6 i = 4 j = 7 i = 4 j = 8 i = 4 j = 9 i = 4 j = 10 i = 4 j = 11 i = 5 j = 1 i = 5 j = 2 i = 5 j = 3 i = 5 j = 4 i = 5 j = 5 i = 5 j = 6 i = 5 j = 7 i = 5 j = 8 i = 5 j = 9 i = 5 j = 10 i = 5 j = 11 i = 6 j = 1 i = 6 j = 2 i = 6 j = 3 i = 6 j = 4 i = 6 j = 5 i = 6 j = 6 i = 6 j = 7 i = 6 j = 8 i = 6 j = 9 i = 6 j = 10 i = 6 j = 11 i = 7 j = 1 i = 7 j = 2 i = 7 j = 3 i = 7 j = 4 i = 7 j = 5 i = 7 j = 6 i = 7 j = 7 i = 7 j = 8 i = 7 j = 9 i = 7 j = 10 i = 7 j = 11 i = 8 j = 1 i = 8 j = 2 i = 8 j = 3 i = 8 j = 4 i = 8 j = 5 i = 8 j = 6 i = 8 j = 7 i = 8 j = 8 i = 8 j = 9 i = 8 j = 10 i = 8 j = 11 i = 9 j = 1 i = 9 j = 2 i = 9 j = 3 i = 9 j = 4 i = 9 j = 5 i = 9 j = 6 i = 9 j = 7 i = 9 j = 8 i = 9 j = 9 i = 9 j = 10 i = 9 j = 11 i = 10 j = 1 i = 10 j = 2 i = 10 j = 3 i = 10 j = 4 i = 10 j = 5 i = 10 j = 6 i = 10 j = 7 i = 10 j = 8 i = 10 j = 9 i = 10 j = 10 i = 10 j = 11 i = 11 j = 1 i = 11 j = 2 i = 11 j = 3 i = 11 j = 4 i = 11 j = 5 i = 11 j = 6 i = 11 j = 7 i = 11 j = 8 i = 11 j = 9 i = 11 j = 10 i = 11 j = 11

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

i = 1 j = 1

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

i = 1 j = 1 i = 1 j = 2 i = 1 j = 3 i = 1 j = 4 i = 1 j = 5 b = 1 i = 1 j = 6 i = 2 j = 1 i = 2 j = 2 i = 2 j = 3 i = 2 j = 4 i = 2 j = 5 i = 2 j = 6 i = 3 j = 1 i = 3 j = 2 i = 3 j = 3 i = 3 j = 4 i = 3 j = 5 i = 3 j = 6 i = 4 j = 1 i = 4 j = 2 i = 4 j = 3 i = 4 j = 4 i = 4 j = 5 i = 4 j = 6 i = 5 j = 1 i = 5 j = 2 i = 5 j = 3 i = 5 j = 4 i = 5 j = 5 i = 5 j = 6 i = 6 j = 1 i = 6 j = 2 i = 6 j = 3 i = 6 j = 4 i = 6 j = 5 i = 6 j = 6

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

i = 1 j = 1 i = 1 j = 2 i = 1 j = 3 i = 1 j = 4 i = 1 j = 5 i = 2 j = 1 i = 2 j = 2 i = 2 j = 3 i = 2 j = 4 i = 2 j = 5 i = 3 j = 1 i = 3 j = 2 i = 3 j = 3 i = 3 j = 4 i = 3 j = 5 i = 4 j = 1 i = 4 j = 2 i = 4 j = 3 i = 4 j = 4 i = 4 j = 5 i = 5 j = 1 i = 5 j = 2 i = 5 j = 3 i = 5 j = 4 i = 5 j = 5

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!