Skip to content

Commit 6f2b502

Browse files
authored
Update count-ways-to-make-array-with-product.py
1 parent f98640a commit 6f2b502

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Python/count-ways-to-make-array-with-product.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Time: O(sqrt(m) + n + q * (logm + sqrt(m)/log(sqrt(m)))), m is max(k for _, k in queries)
1+
# Time: O(sqrt(m) + n + q * (logm + pi(sqrt(m)))) = O(sqrt(m) + n + q * (logm + sqrt(m)/log(sqrt(m)))), m is max(k for _, k in queries), pi(n) = number of primes in a range [1, n] = O(n/logn) by prime number theorem, see https://en.wikipedia.org/wiki/Prime_number_theorem
22
# Space: O(sqrt(m) + n + logm)
33

44
import collections

0 commit comments

Comments
 (0)