Given an integer array nums sorted in non-decreasing order, return an array of the squares of each number sorted in non-decreasing order.
nums = [-4,-1,0,3,10][0,1,9,16,100]In a sorted array, the largest absolute value is always at one of the two ends — either the leftmost (most negative) or rightmost (most positive). By comparing ends and filling the result array from back to front, we always place the correct largest square without sorting. The two pointers meet in the middle.