Here's a little question for you.

Given: A set of items, each with
an associated integer representing
the relative likelihood that each
item will be selected.

Write: A method that will select
a random item.

I've started this a couple of times,
but have become convinced I'm making
it too hard, and someone can probably
come up with a three-liner.

Any ideas?

Cheers,
Hal