Problem 528 · Medium

Random Pick With Weight

Implement weighted random index selection using prefix sum and binary search.

Open the interactive visualisation