977. Squares of a Sorted Array
Given an integer array nums sorted in non-decreasing order, return an array of the squares of each number sorted in non-decreasing order.
采取双指针,同时比较两侧的正负及大小。
1 | class Solution { |
977. Squares of a Sorted Array
Given an integer array nums sorted in non-decreasing order, return an array of the squares of each number sorted in non-decreasing order.
采取双指针,同时比较两侧的正负及大小。
1 | class Solution { |