Skip to content

Commit 310efd1

Browse files
Making it more readable by adding necessary details!
1 parent a71618f commit 310efd1

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

maths/basic_maths.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44

55

66
def prime_factors(n: int) -> list:
7+
"""
8+
Uses a standard method of dividing by 2, then odd divisors up to sqrt(n).
9+
Time Complexity: O(sqrt(n))
10+
Space Complexity: O(log n) on average
11+
"""
712
"""Find Prime Factors.
813
>>> prime_factors(100)
914
[2, 2, 5, 5]
@@ -120,3 +125,4 @@ def euler_phi(n: int) -> int:
120125
import doctest
121126

122127
doctest.testmod()
128+

0 commit comments

Comments
 (0)