Yesterday, I appeared in an interview. I was stuck in one of the question, and I am asking here the same.
There is an array given that shows points on x-axis, there are N points. and M coins also given.
Remember N >= M
You have to maximize the minimum distance between any two points.
Example: Array : 1 3 6 12
3 coins are given.
If you put coins on 1, 3, 6 points Then distance between coins are : 2, 3
So it gives 2 as answer
But we can improve further
If we put coins at 1, 6, 12 points.
Then distances are 5, 6
So correct answer is : 5
Please help me because I am totally stuck in this question.