We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 62a7f11 commit a55025bCopy full SHA for a55025b
09-problems/lc_264_ugly_number_ii.py
@@ -71,7 +71,7 @@ class SolutionHeapQ:
71
# T(n) < Sum(i in [1:n]) 4 log2i
72
# T(n) < 4 log(2 * 4 * ... * 2i * ... 2n) < 4 log(2**n * 1 * 2 * ... * i * ... * n)
73
# T(n) < 4n + 4 logn!
74
- # T(n) = O(n + logn!)
+ # T(n) = O(n + logn!) = O(nlogn)
75
# Space Complexity: S(n) = (3 - 1) + (3 - 1) + ... + (3 - 1) = O(n)
76
# At each iteration, we push 3 items and we pop 1 item.
77
def nth_ugly_number(self, n: int) -> int:
0 commit comments