My LeetCode grinding. Trying to do a problem a day.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

problem.txt 366B

123456789101112131415161718
  1. Given an array of integers A sorted in non-decreasing order, return an array of the squares of each number, also in sorted non-decreasing order.
  2. Example 1:
  3. Input: [-4,-1,0,3,10]
  4. Output: [0,1,9,16,100]
  5. Example 2:
  6. Input: [-7,-3,2,3,11]
  7. Output: [4,9,9,49,121]
  8. Note:
  9. 1 <= A.length <= 10000
  10. -10000 <= A[i] <= 10000
  11. A is sorted in non-decreasing order.