两行代码都可以过,这题也太宽松了吧?
class Solution { public: vector<int> GetLeastNumbers_Solution(vector<int> input, int k) { sort(input.begin(), input.end()); return {input.begin(),input.begin()+k}; } };
class Solution { public: vector<int> GetLeastNumbers_Solution(vector<int> input, int k) { sort(input.begin(), input.end()); return {input.begin(),input.begin()+k}; } };