class Solution { public: vectorGetLeastNumbers_Solution(vector input, int k) { vector res; if(input.empty() || k > input.size()) return res; sort(input.begin(),input.end()); for(int i = 0; i 思路2:最大堆
class Solution { public: vectorGetLeastNumbers_Solution(vector input, int k) { int len = input.size(); vector res; if(len <= 0 || len