[LeetCode] Squares of a Sorted Array (Python)
2024. 2. 27. 10:22ㆍ자료구조
class Solution:
def sortedSquares(self, nums: List[int]) -> List[int]:
square = []
for i in range(len(nums)):
square.append(nums[i]**2)
square = sorted(square)
return square
'자료구조' 카테고리의 다른 글
[LeetCode] Remove Element (Python) (0) | 2024.02.27 |
---|---|
[LeetCode] Merge Sorted Array (Python) (0) | 2024.02.27 |
[LeetCode] Duplicate Zeros (Python) (0) | 2024.02.27 |
[LeetCode] Find Numbers with Even Number of Digits (Python) (0) | 2024.02.27 |
[LeetCode] Max Consecutive Ones (Python) (0) | 2024.02.27 |