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

| The supply chain manager at one of Amazon's warehouses is shipping the last con… |
| Determine the highest value after executing n steps on an infinite 2D grid that… |
| Amazon Prime Video is developing a new feature called "Segmentify." This featur… |
| In this new stock prediction game launched on Amazon Games, Player 1 provides P… |
| Amazon operates numerous warehouses, with each warehouse holding inventory[i] u… |
| In Amazon's highly efficient logistics network, minimizing operational overhead… |