Given a sorted array that contains both positive and negative numbers, how would you return a sorted array of the squares of each number?
Implement sorted_squares(nums), where nums is a nondecreasing list of integers. Return a new list containing every squared value in nondecreasing order, without modifying the input array.
def sorted_squares(nums):