Skip to content

Commit 56f6241

Browse files
committed
Time: 156 ms (59.70%), Space: 18.5 MB (93.14%) - LeetHub
1 parent fb5bc25 commit 56f6241

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

0977-squares-of-a-sorted-array/0977-squares-of-a-sorted-array.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
# time complexity: O(nlogn)
2+
# space complexity: O(1)
13
from typing import List
24

35

46
class Solution:
57
def sortedSquares(self, nums: List[int]) -> List[int]:
68
for i in range(len(nums)):
7-
nums[i] = nums[i] ** 2
9+
nums[i] = nums[i] ** 2
810
return sorted(nums)
911

1012

0 commit comments

Comments
 (0)