Leetcode_easy977. Squares of a Sorted Array

Posted happyamyhope

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Leetcode_easy977. Squares of a Sorted Array相关的知识,希望对你有一定的参考价值。

problem

977. Squares of a Sorted Array

solution:

class Solution 
public:
    vector<int> sortedSquares(vector<int>& A) 
        for(auto &a:A) a *=a;
        sort(A.begin(), A.end());
        return A;       
    
;

 

参考
1. Leetcode_easy_977. Squares of a Sorted Array;

以上是关于Leetcode_easy977. Squares of a Sorted Array的主要内容,如果未能解决你的问题,请参考以下文章

LeetCode 977. Squares of a Sorted Array

LeetCode 977. Squares of a Sorted Array

leetcode977. Squares of a Sorted Array

LeetCode 977 Squares of a Sorted Array

LeetCode --- 977. Squares of a Sorted Array 解题报告

LeetCode 977 Squares of a Sorted Array 解题报告