Answer: Standard Chartered, On-Campus Questions Asked on 31st October, 2022, SET-1

Answer · Posted Nov 2022

Solution for question 1 This problem can be solved using the divide and conquer algorithm. Firstly, we will sort the points according to their x coordinates. Now we will recursively divide the array into two halves, imagine drawing a line in the middle of the points, and calculate the answer for the left and right part. Let dL and dR be the answers for the left part, and right part respectively. Let d = min(dL, dR). We will also need ...

The full answer & interview discussion are available to premium members.

Log in Create a free account