Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.

Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).

Find K-th Smallest Pair Distance

C

Correct me if I am wrong what is the time complexity of first solution, O(n^2*logn) worst case ?

L

@zestypanda Sorry, just noticed that there is something wrong in my original post. The second binary search one is indeed O(nlogm), where m is the value range.

F

Feeling your code is very time-consuming.

Z

ty,nice one.

No one has replied

B

this analysis/tutorial rocks!

@StefanPochmann It does make sense! Thanks man. Upvoted.

@yuryant If max is large, it's gonna consume too much space.

@tiandiao123 But why the binary Search result must be one of the distances?

Y

@simonzhu91 Thanks!! It is right.

Disabled Categories are greyed out

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.