IPInterview Prepininterview-prep.hashnode.dev·May 1, 2021 · 2 min readLeetCode 528: Random Pick with WeightQuestion Given an array of positive numbers, return an index in this array based on the weight of the number occupying that index. For example, for w = [1, 3] , the probability of picking the index 0 is 1 / (1 + 3) = 0.25 (i.e 25%) while the probabi...00