题目:
class Solution {
public:
vector<int> getLeastNumbers(vector<int>& arr, int k) {
vector<int> result;
sort(arr.begin(),arr.end());
for(int i=0;i<k;i++){
result.push_back(arr[i]);
}
return result;
}
};
标签:arr,Offer,int,个数,40,vector
From: https://www.cnblogs.com/fly-smart/p/17660753.html