in the hostel visit question, how is the first output 200
as we have encountered three hostels till that time with distances:
200,162,128
so as per the question the first answer should be 128
and is the rocket distance defined as :
(x2 - x1)2 + (y2 - y1)2
or
(x2 - x1)^2 + (y2 - y1)^2
Problem in Hostel visit Question
we need to get 3rd nearest distance. (k=3)
so 200 is third nearest distance.
Distances are (x1-x2)^2 + (y1-y2)^2