Squares back in order
nums is sorted in non-decreasing order and may hold negatives. Return a new list with the square of every value, also sorted in non-decreasing order. For [-3, -1, 0, 2, 4] the answer is [0, 1, 4, 9, 16].
nums may be empty. Squaring and then sorting costs O(n log n): aim for one O(n) pass, without calling a sort.
Examples
sorted_squares([-3,-1,0,2,4])→[0,1,4,9,16]sorted_squares([-8,-2,1,3,9])→[1,4,9,64,81]sorted_squares([1,2,3])→[1,4,9]