[LeetCode] 977. Squares of a Sorted Array
Python
class Solution:
def sortedSquares(self, nums: List[int]) -> List[int]:
answer = []
for i in nums:
answer.append(i * i)
return sorted(answer)
class Solution:
def sortedSquares(self, nums: List[int]) -> List[int]:
answer = []
for i in nums:
answer.append(i * i)
return sorted(answer)
댓글남기기