Given an integer array nums sorted in non-decreasing order, return a new array of the squares of each number, also sorted in non-decreasing order.
Input: A sorted integer array nums.
Output: Array of squared values sorted in non-decreasing order.
Input: [-4,-1,0,3,10]
Output: [0,1,9,16,100]
Explanation: Squares: [16,1,0,9,100]. Sorted: [0,1,9,16,100].Input: [-7,-3,2,3,11]
Output: [4,9,9,49,121]
Explanation: Squares: [49,9,4,9,121]. Sorted: [4,9,9,49,121].Input: [0,1,2,3,4]
Output: [0,1,4,9,16]
Explanation: All non-negative. Squares already in order.1 <= nums.length <= 10^4-10^4 <= nums[i] <= 10^4nums is sorted non-decreasing.