Test 2 in the test suite is wrong!
25 is clearly a perfect square.
the problem is to see if a number is the square of another number in the vector. Although 25 is a perfect square, 5 is not included in the vector
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
a = [2 3 4];
assert(isequal(isItSquared(a),true))
|
2 | Fail |
a = [20:30];
assert(isequal(isItSquared(a),false))
|
3 | Pass |
a = [1];
assert(isequal(isItSquared(a),true))
|
4 | Pass |
a = [6 10 12 14 36 101];
assert(isequal(isItSquared(a),true))
|
5 | Pass |
a = [6 10 12 14 101];
assert(isequal(isItSquared(a),false))
|
Getting the row and column location from a matrix
236 Solvers
Find the maximum number of decimal places in a set of numbers
734 Solvers
282 Solvers
359 Solvers
1141 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!