Implement weighted random choice | Pinterest Interview Question