4 ms·
What does the prisoner do if she gets to, for example, box 40 and there is a 40 in the box? [edit] I reread the explanation and get it now. Only 1 prisoner (4
by martininmelb 8y ago
What does the prisoner do if she gets to, for example, box 40 and there is a 40 in the box?
[edit] I reread the explanation and get it now. Only 1 prisoner (40) will actually get to open box 40. I was trying to think of this from the point of view of implementing it in code. I guess the cycle stops when a prisoner finds their own number or reaches 50 attempts.
- jakear 8y agoWhy would they have gone to box 40 in the first place had they not gotten a number 40 from elsewhere?