Premium problem118. Histogram Bin Counts

Easy Locked

Compute a histogram of x using bins equal-width bins spanning [lo, hi), and return just the counts array (discard the bin-edges array).

Input

x = [1 0 0 3 1 3 6 6 2 9 4 5 3 8 0]
bins = 4
lo = 1
hi = 7

Output

[3 3 2 2]

Premium problem

This one's part of Premium. Unlock the full NumPy track plus every other premium problem on the site.

Implement solve(...)