【Leetcode】658. Find K Closest Elements


1 特别要注意:the smaller elements are always preferred. 

2 也是binary search的变种:由两边往中间找,直到剩下的array长度是k


1 等号必须写在这里,因为the smaller elements are always preferred. 


1 要记住用abs


你可能感兴趣的:(【Leetcode】658. Find K Closest Elements)