Nokia Coding Question – Solved

10 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


Related Questions

| Given an n x m grid, where rows are numbered from 7 to n and columns from 1 to … |
| There are 'N' coders standing in a line, where i denotes the ith position of a … |
| A birthday party was attended by N number of kids, and each kid was given a uni… |
| Given a matrix of size m * n, where m denotes the number of rows (starting with… |
| A traveler is traveling from the city of Zeta to Omega. He starts with X amount… |
| As an operations engineer at Amazon, you are responsible for organizing the dis… |