Source: AMAZON INTERVIEW QUESTION
Given a point P and other N points in two dimensional space, find K points
C# Solution using LINQ
public int[][] KClosest(int[][] points, int[][] p, int K) { var orderedPoints = points.OrderBy(point => Math.Pow(point[0]-p[0], 2) + Math.Pow(point[1]-p[1], 2)); return orderedPoints.Take(K).ToArray(); }