<p>You are given an integer array <code>arr</code>. Sort the integers in the array in ascending order by the number of <code>1</code>'s in their binary representation and in case of two or more integers have the same number of <code>1</code>'s you have to sort them in ascending order.</p>
<p>Return <em>the array after sorting it</em>.</p>