Cody

# Problem 46. Which doors are open?

Solution 1281042

Submitted on 4 Oct 2017 by Lisa Lisanka
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
x = 1; y_correct = 1; assert(isequal(which_doors_open(x),y_correct))

s = 1 y = 1

2   Pass
x = 3; y_correct = 1; assert(isequal(which_doors_open(x),y_correct))

s = 1 2 3 s = 2 s = 3 y = 1

3   Pass
x = 100; y_correct = [1 4 9 16 25 36 49 64 81 100]; assert(isequal(which_doors_open(x),y_correct))

s = Columns 1 through 30 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 Columns 31 through 60 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 Columns 61 through 90 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 Columns 91 through 100 91 92 93 94 95 96 97 98 99 100 s = Columns 1 through 30 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 Columns 31 through 50 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100 s = Columns 1 through 30 3 6 9 12 15 18 21 24 27 30 33 36 39 42 45 48 51 54 57 60 63 66 69 72 75 78 81 84 87 90 Columns 31 through 33 93 96 99 s = 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 s = 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100 s = 6 12 18 24 30 36 42 48 54 60 66 72 78 84 90 96 s = 7 14 21 28 35 42 49 56 63 70 77 84 91 98 s = 8 16 24 32 40 48 56 64 72 80 88 96 s = 9 18 27 36 45 54 63 72 81 90 99 s = 10 20 30 40 50 60 70 80 90 100 s = 11 22 33 44 55 66 77 88 99 s = 12 24 36 48 60 72 84 96 s = 13 26 39 52 65 78 91 s = 14 28 42 56 70 84 98 s = 15 30 45 60 75 90 s = 16 32 48 64 80 96 s = 17 34 51 68 85 s = 18 36 54 72 90 s = 19 38 57 76 95 s = 20 40 60 80 100 s = 21 42 63 84 s = 22 44 66 88 s = 23 46 69 92 s = 24 48 72 96 s = 25 50 75 100 s = 26 52 78 s = 27 54 81 s = 28 56 84 s = 29 58 87 s = 30 60 90 s = 31 62 93 s = 32 64 96 s = 33 66 99 s = 34 68 s = 35 70 s = 36 72 s = 37 74 s = 38 76 s = 39 78 s = 40 80 s = 41 82 s = 42 84 s = 43 86 s = 44 88 s = 45 90 s = 46 92 s = 47 94 s = 48 96 s = 49 98 s = 50 100 s = 51 s = 52 s = 53 s = 54 s = 55 s = 56 s = 57 s = 58 s = 59 s = 60 s = 61 s = 62 s = 63 s = 64 s = 65 s = 66 s = 67 s = 68 s = 69 s = 70 s = 71 s = 72 s = 73 s = 74 s = 75 s = 76 s = 77 s = 78 s = 79 s = 80 s = 81 s = 82 s = 83 s = 84 s = 85 s = 86 s = 87 s = 88 s = 89 s = 90 s = 91 s = 92 s = 93 s = 94 s = 95 s = 96 s = 97 s = 98 s = 99 s = 100 y = 1 4 9 16 25 36 49 64 81 100

### Community Treasure Hunt

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

Start Hunting!