Problem 47668. A KING AND 100 PRISONERS
Solution Stats
Problem Comments
-
3 Comments
Nice. On the other hand, the test suite should probably forbid people from returning any number between 20 and 40. Just open the file and look for these numbers and their multiples explicitly.
And by the way, it would be faster if all prisoners could turn off the light. They only need to have a variable known by all who share the room but the king. Leave the king doubtful and in the dark, so they would all go free.
On top of what Rafael said, "20 <= prisoners <= 40" does not do what you apparently think it does.
Solution Comments
Show commentsProblem Recent Solvers20
Suggested Problems
-
Return unique values without sorting
998 Solvers
-
Return the first and last characters of a character array
11787 Solvers
-
446 Solvers
-
Add one raw in given matrix as shown in example
149 Solvers
-
Find out sum of all elements of given Matrix
532 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!