Random Pick with Weight
CodingPhone, OnsiteSoftware Engineer, Machine Learning EngineerReported Aug, 2026High Frequency
Company question banks are included with the Insider plan.
You are given a 0-indexed array of positive integers w where w[i] describes the weight of the i-th index.
You need to implement pickIndex(), which randomly picks an index in the range...