Given an array or stream of `N` distinct elements and an integer `K` ( where `1 <= K <= N`), randomly select `K` elements such that every subset of size `K` has an equal probability of being chosen…
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.