Question d’entretien chez LinkedIn

Write a function to sample from a non-uniform distribution