Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Solution 14129

Submitted on 29 Jan 2012

Incorrect

18Size
Leading solution size is 31.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test
Code Input and Output
1
Pass
 

                      

                    
2
Pass
 
%%
x = 704;
tf_correct = false;
assert(isequal(kap(x),tf_correct))

                    
3
Pass
 
%%
x = 9
tf_correct = true
assert(isequal(kap(x),tf_correct))
x =
     9
tf_correct =
     1
4
Pass
 
%%
x = 45
tf_correct = true
assert(isequal(kap(x),tf_correct))
x =
    45
tf_correct =
     1
5
Fail
 
%%
x = 55
tf_correct = true
assert(isequal(kap(x),tf_correct))
Error: Assertion failed.
6
Pass
 
%%
x = 99
tf_correct = true
assert(isequal(kap(x),tf_correct))
x =
    99
tf_correct =
     1
7
Pass
 
%%
x = 297
tf_correct = true
assert(isequal(kap(x),tf_correct))
x =
   297
tf_correct =
     1
8
Fail
 
%%
x = 703
tf_correct = true
assert(isequal(kap(x),tf_correct))
Error: Assertion failed.
9
Fail
 
%%
x = 999
tf_correct = true
assert(isequal(kap(x),tf_correct))
Error: Assertion failed.
10
Fail
 
%%
x = 2223
tf_correct = true
assert(isequal(kap(x),tf_correct))
Error: Assertion failed.
11
Fail
 
%%
x = 2728
tf_correct = true
assert(isequal(kap(x),tf_correct))
Error: Assertion failed.
12
Fail
 
%%
x = 4950
tf_correct = true
assert(isequal(kap(x),tf_correct))
Error: Assertion failed.
13
Fail
 
%%
x = 5050
tf_correct = true
assert(isequal(kap(x),tf_correct))
Error: Assertion failed.
14
Fail
 
%%
x = 7272
tf_correct = true
assert(isequal(kap(x),tf_correct))
Error: Assertion failed.
15
Fail
 
%%
x = 7777
tf_correct = true
assert(isequal(kap(x),tf_correct))
Error: Assertion failed.
16
Fail
 
%%
x = 9999
tf_correct = true
assert(isequal(kap(x),tf_correct))
Error: Assertion failed.
17
Fail
 
%%
x = 17344
tf_correct = true
assert(isequal(kap(x),tf_correct))
Error: Assertion failed.
18
Fail
 
%%
x = 22222
tf_correct = true
assert(isequal(kap(x),tf_correct))
Error: Assertion failed.
19
Fail
 
%%
x = 77778
tf_correct = true
assert(isequal(kap(x),tf_correct))
Error: Assertion failed.
20
Fail
 
%%
x = 82656
tf_correct = true
assert(isequal(kap(x),tf_correct))
Error: Assertion failed.
21
Fail
 
%%
x = 95121
tf_correct = true
assert(isequal(kap(x),tf_correct))
Error: Assertion failed.
22
Fail
 
%%
x = 99999
tf_correct = true
assert(isequal(kap(x),tf_correct))
Error: Assertion failed.
23
Fail
 
%%
x = 142857
tf_correct = true
assert(isequal(kap(x),tf_correct))
Error: Assertion failed.
24
Fail
 
%%
x = 148149
tf_correct = true
assert(isequal(kap(x),tf_correct))
Error: Assertion failed.
25
Fail
 
%%
x = 181819
tf_correct = true
assert(isequal(kap(x),tf_correct))
Error: Assertion failed.
26
Fail
 
%%
x = 187110
tf_correct = true
assert(isequal(kap(x),tf_correct))
Error: Assertion failed.
27
Fail
 
%%
x = 208495
tf_correct = true
assert(isequal(kap(x),tf_correct))
Error: Assertion failed.
28
Fail
 
%%
x = 318682
tf_correct = true
assert(isequal(kap(x),tf_correct))
Error: Assertion failed.
29
Fail
 
%%
x = 329967
tf_correct = true
assert(isequal(kap(x),tf_correct))
Error: Assertion failed.
30
Fail
 
%%
x = 351352
tf_correct = true
assert(isequal(kap(x),tf_correct))
Error: Assertion failed.
31
Fail
 
%%
x = 356643
tf_correct = true
assert(isequal(kap(x),tf_correct))
Error: Assertion failed.
32
Fail
 
%%
x = 390313
tf_correct = true
assert(isequal(kap(x),tf_correct))
Error: Assertion failed.
33
Fail
 
%%
x = 461539
tf_correct = true
assert(isequal(kap(x),tf_correct))
Error: Assertion failed.
34
Fail
 
%%
x = 466830
tf_correct = true
assert(isequal(kap(x),tf_correct))
Error: Assertion failed.
35
Fail
 
%%
x = 499500
tf_correct = true
assert(isequal(kap(x),tf_correct))
Error: Assertion failed.
36
Fail
 
%%
x = 500500
tf_correct = true
assert(isequal(kap(x),tf_correct))
Error: Assertion failed.
37
Fail
 
%%
x = 533170
tf_correct = true
assert(isequal(kap(x),tf_correct))
Error: Assertion failed.
38
Fail
 
%%
x = 538461
tf_correct = true
assert(isequal(kap(x),tf_correct))
Error: Assertion failed.
39
Fail
 
%%
x = 609687
tf_correct = true
assert(isequal(kap(x),tf_correct))
Error: Assertion failed.
40
Fail
 
%%
x = 643357
tf_correct = true
assert(isequal(kap(x),tf_correct))
Error: Assertion failed.
41
Fail
 
%%
x = 648648
tf_correct = true
assert(isequal(kap(x),tf_correct))
Error: Assertion failed.
42
Fail
 
%%
x = 670033
tf_correct = true
assert(isequal(kap(x),tf_correct))
Error: Assertion failed.
43
Fail
 
%%
x = 681318
tf_correct = true
assert(isequal(kap(x),tf_correct))
Error: Assertion failed.
44
Pass
 
%%
x = 681319
tf_correct = false
assert(isequal(kap(x),tf_correct))
x =
      681319
tf_correct =
     0
45
Pass
 
%%
x = 681320
tf_correct = false
assert(isequal(kap(x),tf_correct))
x =
      681320
tf_correct =
     0