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