~/boss / loot-goblin
The Loot Goblin
Stack its loot weights end to end, then find who owns each roll in 4 peeks.
Loading the fight…
How to beat it
Lay the weights end to end: each item ends at the running total, so a heavier item owns a longer stretch. A roll lands somewhere on that line. Peek at the middle item's end: the roll is at or before it? The winner is that item or one to its left. Past it? One to its right. Half the table goes each time, so 12 items take at most 4 peeks.
Now the real boss
Interviews ask for the code. Watch it run, then write it yourself, tested in Python, C++ or Java.
On your phone? Writing code is easier on a laptop: open bossfight.dev/problems/random-pick-with-weight there. Sign in with your email to keep your progress on every device.