4 ms·
If you store the number of zeros as value z, computing z+1 is O(log n) in the long run for unbounded values of z.
by matvore 3y ago
If you store the number of zeros as value z, computing z+1 is O(log n) in the long run for unbounded values of z.