function sortedSquares(nums: number[]): number[] { return nums.toSorted((a, b) => Math.abs(a) - Math.abs(b)).map(num => Math.pow(num, 2)) };