題目
Given an integer array nums sorted in non-decreasing order, return an array of the squares of each number sorted in non-decreasing order.
Example 1
1 | Input: nums = [-4,-1,0,3,10] |
Example 2
1 | Input: nums = [-7,-3,2,3,11] |
Constraints:
- 1 <= nums.length <= 104
- -104 <= nums[i] <= 104
- nums is sorted in non-decreasing order.
我的解題
1 | class Solution { |