Cody

# Problem 46. Which doors are open?

Solution 1050971

Submitted on 11 Nov 2016
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   Fail
x = 1; y_correct = 1; assert(isequal(which_doors_open(x),y_correct))

v = 1 y = []

Assertion failed.

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

v = 1 1 1 v = 1 2 1 v = 1 2 2 y = []

Assertion failed.

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

v = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 v = 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 v = 1 2 2 2 1 3 1 2 2 2 1 3 1 2 2 2 1 3 1 2 2 2 1 3 1 2 2 2 1 3 1 2 2 2 1 3 1 2 2 2 1 3 1 2 2 2 1 3 1 2 2 2 1 3 1 2 2 2 1 3 1 2 2 2 1 3 1 2 2 2 1 3 1 2 2 2 1 3 1 2 2 2 1 3 1 2 2 2 1 3 1 2 2 2 1 3 1 2 2 2 v = 1 2 2 3 1 3 1 3 2 2 1 4 1 2 2 3 1 3 1 3 2 2 1 4 1 2 2 3 1 3 1 3 2 2 1 4 1 2 2 3 1 3 1 3 2 2 1 4 1 2 2 3 1 3 1 3 2 2 1 4 1 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