LeetCode #977: Squares of a Sorted Array
βΆ
30 Dec, 2025
β’ 24 words β’ 1 min
β’ updated 03 Jan, 2026
LeetCode #977: Squares of a Sorted Array :
class Solution :
def sortedSquares ( self , nums : List [ int ]) -> List [ int ]:
return list ( sorted ( num ** 2 for num in nums ))
Related Posts
LeetCode #167: Two Sum II β Input Array Is Sorted:
Classic, linear:
python class Solution: def twoSum(self, numbers: List[int], target: int) -> β¦
Jan 06, 2026
LeetCode #80: Duplicate From Sorted Array II:
Previously. Now each element can appear at most twice.
Elegant # Keeping track of a counter is the most β¦
Sep 05, 2025
Previously , previously , previously , previously , previously .
Thiago Perrotta