Cody

# Problem 23. Finding Perfect Squares

Solution 2012113

Submitted on 10 Nov 2019 by kristie moore
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))

c = 3 f = 1 i = 4 f = 0 f = -1 f = 99999999 i = 9 f = 99999998 f = 99999997 f = 99999996 i = 16 f = 99999995 f = 99999994 f = 99999993 b = logical 1

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

c = 11 f = 1 i = 400 f = 0 f = -1 f = -2 f = -3 f = -4 f = -5 f = -6 f = -7 f = -8 f = -9 f = -10 i = 441 f = -11 f = -12 f = -13 f = -14 f = -15 f = -16 f = -17 f = -18 f = -19 f = -20 f = -21 i = 484 f = -22 f = -23 f = -24 f = -25 f = -26 f = -27 f = -28 f = -29 f = -30 f = -31 f = -32 i = 529 f = -33 f = -34 f = -35 f = -36 f = -37 f = -38 f = -39 f = -40 f = -41 f = -42 f = -43 i = 576 f = -44 f = -45 f = -46 f = -47 f = -48 f = -49 f = -50 f = -51 f = -52 f = -53 f = -54 i = 625 f = -55 f = -56 f = -57 f = -58 f = -59 f = -60 f = -61 f = -62 f = -63 f = -64 f = -65 i = 676 f = -66 f = -67 f = -68 f = -69 f = -70 f = -71 f = -72 f = -73 f = -74 f = -75 f = -76 i = 729 f = -77 f = -78 f = -79 f = -80 f = -81 f = -82 f = -83 f = -84 f = -85 f = -86 f = -87 i = 784 f = -88 f = -89 f = -90 f = -91 f = -92 f = -93 f = -94 f = -95 f = -96 f = -97 f = -98 i = 841 f = -99 f = -100 f = -101 f = -102 f = -103 f = -104 f = -105 f = -106 f = -107 f = -108 f = -109 i = 900 f = -110 f = -111 f = -112 f = -113 f = -114 f = -115 f = -116 f = -117 f = -118 f = -119 f = -120 b = logical 0

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

c = 1 f = 1 i = 1 f = 100000001 b = logical 1

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

c = 6 f = 1 i = 36 f = 0 f = -1 f = -2 f = -3 f = 99999997 f = 99999996 i = 100 f = 99999995 f = 99999994 f = 99999993 f = 99999992 f = 99999991 f = 99999990 i = 144 f = 99999989 f = 99999988 f = 99999987 f = 99999986 f = 99999985 f = 99999984 i = 196 f = 99999983 f = 99999982 f = 99999981 f = 99999980 f = 99999979 f = 99999978 i = 1296 f = 99999977 f = 99999976 f = 99999975 f = 99999974 f = 99999973 f = 99999972 i = 10201 f = 99999971 f = 99999970 f = 99999969 f = 99999968 f = 99999967 f = 99999966 b = logical 1

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

c = 5 f = 1 i = 36 f = 0 f = -1 f = -2 f = -3 f = -4 i = 100 f = -5 f = -6 f = -7 f = -8 f = -9 i = 144 f = -10 f = -11 f = -12 f = -13 f = -14 i = 196 f = -15 f = -16 f = -17 f = -18 f = -19 i = 10201 f = -20 f = -21 f = -22 f = -23 f = -24 b = logical 0