Cody

Problem 248. Twins in a Window

Solution 737091

Submitted on 16 Sep 2015 by Zikobrelli
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
%% lowVal = 10; highVal = 50; p = [11 13 17 19 29 31 41 43]; assert(isequal(window_twins(lowVal,highVal),p))

A = 11 13 17 19 23 29 31 37 41 43 47 A = 11 17 29 41 p = 11 13 17 19 29 31 41 43

2   Pass
%% lowVal = 1000; highVal = 1050; p = [1019 1021 1031 1033]; assert(isequal(window_twins(lowVal,highVal),p))

A = 1009 1013 1019 1021 1031 1033 1039 1049 A = 1019 1031 p = 1019 1021 1031 1033

3   Pass
%% lowVal = 3120; highVal = 3300; p = [ 3167 3169 3251 3253 3257 3259]; assert(isequal(window_twins(lowVal,highVal),p))

A = Columns 1 through 15 3121 3137 3163 3167 3169 3181 3187 3191 3203 3209 3217 3221 3229 3251 3253 Columns 16 through 19 3257 3259 3271 3299 A = 3167 3251 3257 p = 3167 3169 3251 3253 3257 3259

Suggested Problems

More from this Author50

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!