Find K nearest Points to Point P in 2-dimensional plane

后端 未结 9 1795
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-31 04:27

Source: AMAZON INTERVIEW QUESTION

Given a point P and other N points in two dimensional space, find K points

9条回答
  •  灰色年华
    2021-01-31 04:49

    class Solution {
       public int[][] kClosest(int[][] points, int K) {
            double [] combinationArr = new double[points.length];
            Hashtable pt = new Hashtable();
            for (int i = 0; i 

提交回复
热议问题