🎁 Exclusive Offer! Join our Telegram Channel to get **special discounts** and updates! 🚀

🚀 Struggling with coding interviews? We've got you covered! 💡 Practice real questions, sharpen your skills, and land your dream job! 🎯
Question 22 - 100% Working Solution | Buy Now

Description

3 Live
Homework The distance between 2 points (x y1) and (x2 y2) on a 2D plane is defined as But Paul, the math teacher, defined the distance between 2 points (x1, y1) and (x2,y2) on a 2D plane as min(|z1-z2l, [y/1 - val) in his class. As homework, he gave N points to the students and asked Min smallest distance between all possible pairs of points according to his new definition. You are given N points on a 2D plane. Help the students to complete the homework. Calculate the Mh smallest distance according to Paul's new definition of distance. Notes - Assume #based indexing. - All N points are unique. - Mth smallest distance stands for Mth element you get by arranging all possible distances in increasing order. Function description Complete the function homework. This function takes the following 3 parameters and returns the required answer, an integer, the Mth smallest distance: - N: Represents an integer denoting total points - Points: Represents an array of pairs representing points on a 2D plane - M. Represents the required smallest distance

Asked in: Nokia

Image of the Question

Question Image

All Testcases Passed ✔



Passcode Image

Solution


Please login to view the solution