DIY: Random Pick with Weight
Explore how to implement a weighted random index picker in C#, a useful technique for interview problems involving probability and optimization. Understand how to assign higher chances to heavier weights, similar to Uber's driver allocation strategy, and create a pickIndex function that returns an index based on weighted probabilities.
We'll cover the following...
We'll cover the following...
Problem statement
You are given an array of positive integers, w, where w[i] describes the weight of the ...