logoalt Hacker News

tristanj • today at 2:05 AM • 1 reply • view on HN

You can also solve this in O(logn) using a physical binary search:

1) Move half the boxes to another room.

2) Listen for a beep and determine which room the beep comes from.

3) Take the boxes in that room and split it in half again.

4) Repeat until one box is left.


Replies

ARandomerDude • today at 2:13 AM

> Move half the boxes to another room.

Alternatively, no.