构建一个堆。进行堆排序 参考: 文章:https://kouder.cn/post/zui-xiao-de-k-ge-shu/视频:https://www.bilibili.com/video/BV1Eb41147dK function GetLeastNumbers_Solution(input, k) { // write code here if (k > input.length) { return []; } function swap(arr, i, j) { const temp = arr[i]; ...