Problem statement

https://binarysearch.com/problems/Square-of-a-List/

Solution

Equal to leetcode 0977. Squares of a Sorted Array

Complexity

It is O(n) if fact, because python uses timsort.

Code

class Solution:
    def solve(self, nums):
        return sorted([i * i for i in nums])