Meaning of "number of keys in the range $a$ to $b$"
It probably means &quot;the number of array elements whose value is between $a$ and $b$&quot;.
For the solution, it is crucial that the number of possible values of array elements is $O(1)$.