There are corner cases you don't cover, e.g.,

~~~
1
2
3
0
~~~

Ignoring `0`, the min value is `1`. Basically, if nnz is smaller than count, you need to update min and max by comparing them to `0`.