Core Idea
The answer is a distance. If it is possible to place all items with minimum distance d, then every smaller distance is also possible.
Algorithm
Binary search the distance. For a fixed distance, greedily place at the earliest position that is far enough from the last chosen position.
Common Mistakes
Sort the positions first. The feasibility check should count placements, not gaps, and it should succeed as soon as enough items are placed.