본문 바로가기
개발/알고리즘

Squares of a Sorted Array

by ny0011 2021. 1. 23.
반응형

 

 

 

 

class Solution:
    def sortedSquares(self, nums: List[int]) -> List[int]:
        nums = [ num*num for num in nums]
        return sorted(nums)

 

137 / 137 test cases passed.
Status: Accepted
Runtime: 208 ms
Memory Usage: 16.1 MB

leetcode.com/explore/learn/card/fun-with-arrays/521/introduction/3240/

 

Account Login - LeetCode

Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.

leetcode.com

 

'개발 > 알고리즘' 카테고리의 다른 글

코드 구현하기  (0) 2021.01.29
별 찍기  (0) 2021.01.28
Find Numbers with Even Number of Digits  (0) 2021.01.22
485. Max Consecutive Ones  (0) 2021.01.22
파이썬 알고리즘 꿀팁  (0) 2020.12.09

댓글