Generating random numbers with weighted probabilities in python
<p>Given a positive integer array <code>a</code>, the goal is to generate 5 random numbers based on the weight they have in the array.</p>

<p>For example:</p>

<pre><code>a = [2,3,4,4,4,4,4,6,7,8,9]
</code></pre>

<p>In this case the number 4 has appeared 5 times, in this case the number 4 should have the probability of 5/11 to appear.</p>

<p>No numbers should be repeated.</p>