Skip to content

Commit a55025b

Browse files
author
Hamid Gasmi
committed
#227 is completed in 3 different ways
1 parent 62a7f11 commit a55025b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

09-problems/lc_264_ugly_number_ii.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class SolutionHeapQ:
7171
# T(n) < Sum(i in [1:n]) 4 log2i
7272
# T(n) < 4 log(2 * 4 * ... * 2i * ... 2n) < 4 log(2**n * 1 * 2 * ... * i * ... * n)
7373
# T(n) < 4n + 4 logn!
74-
# T(n) = O(n + logn!)
74+
# T(n) = O(n + logn!) = O(nlogn)
7575
# Space Complexity: S(n) = (3 - 1) + (3 - 1) + ... + (3 - 1) = O(n)
7676
# At each iteration, we push 3 items and we pop 1 item.
7777
def nth_ugly_number(self, n: int) -> int:

0 commit comments

Comments
 (0)