Leetcode 398 - Random Pick Index (Variation)
OG: https://leetcode.com/problems/random-pick-index/description/
Variation: select K random elements from an array
Modified Fisher-Yates (Knuth) shuffle - for when array can be modified
Reservoir sampling - for streaming data or when array modifica...
sachinhandiekar.com3 min read