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;
Finish
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;
Finish