Skip to content

Commit

Permalink
Update count-the-number-of-ideal-arrays.py
Browse files Browse the repository at this point in the history
  • Loading branch information
kamyu104 authored Oct 8, 2023
1 parent 3821524 commit 6fa052c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Python/count-the-number-of-ideal-arrays.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def linear_sieve_of_eratosthenes(n): # Time: O(n), Space: O(n)
def prime_factors(x):
factors = collections.Counter()
for p in primes:
if x < p:
if p*p > x:
break
while x%p == 0:
factors[p] += 1
Expand Down

0 comments on commit 6fa052c

Please sign in to comment.