Randomize dynamic array with constraint array.sum()

In reply to cgales:

it works
Thank you!