# 977. Squares of a Sorted Array

{% embed url="<https://leetcode.com/problems/squares-of-a-sorted-array/>" %}

```python
class Solution:
    def sortedSquares(self, A: List[int]) -> List[int]:
        return [x**2 for x in sorted(A, key=lambda x: abs(x))]
```
