Problem 398 · Medium

Random Pick Index

Pick a random index with value equal to target. All indices with target value are equally likely.

Open the interactive visualisation