Domanda di colloquio di LinkedIn

Write a function to sample from a non-uniform distribution