Problem 46. Which doors are open?
Solution Stats
Problem Comments
-
9 Comments
The description does not match the example: The point 3 should be "3. On the # trip down the alley, start with door # [and process every #-th door]".
I agree with Jan - the description is not clear. The final instruction should be "return the list of open door #'s", presumably.
If the description was clearer, I'd give this problem a "like", because a good solution depends on a good analysis of the problem more than on just neat coding.
Sorry about the confusion. I tried to clarify the problem description.
Nice problem! The explicit solution was very surprising to me once I found it.
Classic problem--unfortunate that the test suite reveals the punchline.
Yes I initially thought y = sum(open doors)
good problem, easy solution once realising how to solve
easy if to think a bit
Solution Comments
-
1 Comment
good
-
2 Comments
though I did not understand the question...
the problem are not clear, could you explain me?
-
1 Comment
Very nice solution without for loop
-
1 Comment
Problem isn't robust to direction of vector
-
1 Comment
Genius!
-
2 Comments
Nice explanation. I just derivated the formula from the solution ;-)
Thanks for the explanation.
Problem Recent Solvers2814
Suggested Problems
-
2300 Solvers
-
1458 Solvers
-
Least common multiple of many numbers
216 Solvers
-
Flip the vector from right to left
6571 Solvers
-
834 Solvers
More from this Author96
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!