Sort an Array of Points by their distance from a reference Point
Given an array arr[] containing N points and a reference point P, the task is to sort these points according to their distance from the given point P. Examples: Input: arr[] = {{5, 0}, {4, 0}, {3, 0}, {2, 0}, {1, 0}}, P = (0, 0) Output: (1, 0) (2, 0) (3, 0) (4, 0) (5, 0) Explanation: Distance betwee