Cody

Solution 1260263

Submitted on 1 Sep 2017 by Yoshimasa Nakatani
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))

s = 4 fg = 1×3 logical array 0 0 1 s = 9 fg = 1×3 logical array 0 0 0 s = 16 fg = 1×3 logical array 0 0 0

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

s = 400 fg = 1×11 logical array 0 0 0 0 0 0 0 0 0 0 0 s = 441 fg = 1×11 logical array 0 0 0 0 0 0 0 0 0 0 0 s = 484 fg = 1×11 logical array 0 0 0 0 0 0 0 0 0 0 0 s = 529 fg = 1×11 logical array 0 0 0 0 0 0 0 0 0 0 0 s = 576 fg = 1×11 logical array 0 0 0 0 0 0 0 0 0 0 0 s = 625 fg = 1×11 logical array 0 0 0 0 0 0 0 0 0 0 0 s = 676 fg = 1×11 logical array 0 0 0 0 0 0 0 0 0 0 0 s = 729 fg = 1×11 logical array 0 0 0 0 0 0 0 0 0 0 0 s = 784 fg = 1×11 logical array 0 0 0 0 0 0 0 0 0 0 0 s = 841 fg = 1×11 logical array 0 0 0 0 0 0 0 0 0 0 0 s = 900 fg = 1×11 logical array 0 0 0 0 0 0 0 0 0 0 0

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

s = 1 fg = logical 1

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

s = 36 fg = 1×6 logical array 0 0 0 0 1 0 s = 100 fg = 1×6 logical array 0 0 0 0 0 0 s = 144 fg = 1×6 logical array 0 0 0 0 0 0 s = 196 fg = 1×6 logical array 0 0 0 0 0 0 s = 1296 fg = 1×6 logical array 0 0 0 0 0 0 s = 10201 fg = 1×6 logical array 0 0 0 0 0 0

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

s = 36 fg = 1×5 logical array 0 0 0 0 0 s = 100 fg = 1×5 logical array 0 0 0 0 0 s = 144 fg = 1×5 logical array 0 0 0 0 0 s = 196 fg = 1×5 logical array 0 0 0 0 0 s = 10201 fg = 1×5 logical array 0 0 0 0 0

Suggested Problems

More from this Author95