Roulette wheel style selection from Array

I would appreciate some help.

I have an array of floats. Each has a certain weight/value. Sum of those weights/values = 100%.
I want to randomly select one of the floats but to take into the account their weight. So if one of the floats has 0.60 value for example, chance to randomly select it will be 60%.

I can’t seem to wrap my head around on how to do it. I would appreciate some advice.
I’m a beginner in blueprints, so please don’t hate if its a very stupid question.

Thanks!

Something like the attached image should work.

Silly way to think about it:
Imagine you have a bowl that you pour a random amount of water into, from empty to full, 0-1.
Then each of your weights represents a glass of a certain size, their combined sizes adds up to 1.0.
One by one you then take a glass and remove water from the bowl.
The last glass you need to use to empty the bucket will be your selected one.

For instance, your glasses are the following sizes:
0.4,
0.2,
0.1,
0.3,

Then you randomize a water amount between 0-1. If the number was lower than 0.4 the first glass would empty the bowl.
If the number is between 0.4 and 0.6 the second glass will empty the bowl.
At 0.6-0.7 the third glass will empty it.
And if you poured in between 0.7 and 1, you’ll need the final glass to empty it.

Hello! Thank you for the suggestion. I ended up with the following solution. Do you think it is OK? I feed an array of floats and get a random index that also takes into the account their weight.