Let's say $P$ is a plane of $n$ points and $R$ axis-aligned minimum bounding rectangle. I need to find empty, axis-aligned square of size $1$ inside $R$ (if it exists), using sweep-line algorithm in $O(n \log n)$.
I had several ideas including: sorting points by x-coordinate and sweep through them, then adding them to a data structure (for example binary search tree) if the distance on x-axis between them was $\leq1$ and sorting them by y-coordinate, but I got stuck and haven't been able to figure out the solution.
Is there a data structure that would be useful in solving this problem?
Any advice would be very much appreciated.