Cody

Solution 1917254

Submitted on 31 Aug 2019 by Eilish O'Grady
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))

len = 3 v = 1 1 1 v = 4 1 1 v = 4 9 1 v = 4 9 16 remove_dup = 2 3 4 9 16 sz_remove_dup = 1 5 sz_a_v = 1 6 b = logical 1

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

len = 11 v = 1 1 1 1 1 1 1 1 1 1 1 v = 400 1 1 1 1 1 1 1 1 1 1 v = 400 441 1 1 1 1 1 1 1 1 1 v = 400 441 484 1 1 1 1 1 1 1 1 v = 400 441 484 529 1 1 1 1 1 1 1 v = 400 441 484 529 576 1 1 1 1 1 1 v = 400 441 484 529 576 625 1 1 1 1 1 v = 400 441 484 529 576 625 676 1 1 1 1 v = 400 441 484 529 576 625 676 729 1 1 1 v = 400 441 484 529 576 625 676 729 784 1 1 v = 400 441 484 529 576 625 676 729 784 841 1 v = 400 441 484 529 576 625 676 729 784 841 900 remove_dup = 20 21 22 23 24 25 26 27 28 29 30 400 441 484 529 576 625 676 729 784 841 900 sz_remove_dup = 1 22 sz_a_v = 1 22 b = logical 0

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

len = 1 v = 1 v = 1 remove_dup = 1 sz_remove_dup = 1 1 sz_a_v = 1 2 b = logical 1

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

len = 6 v = 1 1 1 1 1 1 v = 36 1 1 1 1 1 v = 36 100 1 1 1 1 v = 36 100 144 1 1 1 v = 36 100 144 196 1 1 v = 36 100 144 196 1296 1 v = 36 100 144 196 1296 10201 remove_dup = 6 10 12 14 36 100 101 144 196 1296 10201 sz_remove_dup = 1 11 sz_a_v = 1 12 b = logical 1

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

len = 5 v = 1 1 1 1 1 v = 36 1 1 1 1 v = 36 100 1 1 1 v = 36 100 144 1 1 v = 36 100 144 196 1 v = 36 100 144 196 10201 remove_dup = 6 10 12 14 36 100 101 144 196 10201 sz_remove_dup = 1 10 sz_a_v = 1 10 b = logical 0