Problem bank

Problem 75 of 333HardCodingP075

Reservoir sampling

  1. Stream of unknown length. Select 1 element uniformly at random with constant memory.