Given a non-negative integers array a
with different len(a)
(scale) and different max(a)
(amplitude), what is the most efficient way in Python to count the unique elements in a
?
In this experiment, we fix the scale len(a)
to be 20000, and focus specifically on the amplitude max(a)
of the array.
Here is the code:
def get_runtime_stat(AMPLITUDE:int):
def _test1():
counts = np.zeros((AMPLITUDE + 1, ), dtype=np.int32)