
Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
First, imagine that there is exactly one open door and try to solve the problem.
Now close an opened door.
Then visit k houses by going right. If there is no open door, your assumption of having exactly one open door was right, and you have the answer.
If there is still an open door, go to step 1.